Search in sources :

Example 1 with KillBillShiroAopModule

use of org.killbill.billing.util.glue.KillBillShiroAopModule in project killbill by killbill.

the class TestEntitlementModule method configure.

@Override
protected void configure() {
    super.configure();
    install(new CacheModule(configSource));
    install(new ConfigModule(configSource));
    install(new EventModule(configSource));
    install(new CallContextModule(configSource));
    install(new MockTenantModule(configSource));
    install(new KillBillShiroModuleOnlyIniRealm(configSource));
    install(new KillBillShiroAopModule(configSource));
    install(new SecurityModule(configSource));
}
Also used : MockTenantModule(org.killbill.billing.mock.glue.MockTenantModule) KillBillShiroAopModule(org.killbill.billing.util.glue.KillBillShiroAopModule) EventModule(org.killbill.billing.util.glue.EventModule) CallContextModule(org.killbill.billing.util.glue.CallContextModule) ConfigModule(org.killbill.billing.util.glue.ConfigModule) CacheModule(org.killbill.billing.util.glue.CacheModule) SecurityModule(org.killbill.billing.util.glue.SecurityModule)

Example 2 with KillBillShiroAopModule

use of org.killbill.billing.util.glue.KillBillShiroAopModule in project killbill by killbill.

the class KillpayServerModule method installKillbillModules.

@Override
protected void installKillbillModules() {
    install(new AuditModule(configSource));
    install(new NodesModule(configSource));
    install(new BroadcastModule(configSource));
    install(new BeatrixModule(configSource));
    install(new CacheModule(configSource));
    install(new ConfigModule(configSource));
    install(new EventModule(configSource));
    install(new CallContextModule(configSource));
    install(new CurrencyModule(configSource));
    install(new CustomFieldModule(configSource));
    install(new DefaultAccountModule(configSource));
    install(new ExportModule(configSource));
    install(new GlobalLockerModule(configSource));
    install(new KillBillShiroAopModule(configSource));
    final ConfigurationObjectFactory factory = new ConfigurationObjectFactory(skifeConfigSource);
    final JaxrsConfig jaxrsConfig = factory.build(JaxrsConfig.class);
    install(new KillbillApiAopModule(jaxrsConfig));
    install(new JaxRSAopModule(jaxrsConfig));
    install(new KillBillShiroWebModule(servletContext, skifeConfigSource));
    install(new NonEntityDaoModule(configSource));
    install(new PaymentModule(configSource));
    install(new RecordIdModule(configSource));
    install(new SecurityModule(configSource));
    install(new TagStoreModule(configSource));
    install(new DefaultTenantModule(configSource));
    // TODO Required by payment for InvoiceInternalApi and InvoicePaymentApi
    install(new DefaultInvoiceModule(configSource));
    // TODO Dependencies for DefaultInvoiceModule
    install(new CatalogModule(configSource));
    install(new DefaultEntitlementModule(configSource));
    install(new DefaultJunctionModule(configSource));
    install(new DefaultSubscriptionModule(configSource));
    install(new TemplateModule(configSource));
    install(new UsageModule(configSource));
    install(new DefaultJaxrsModule(configSource));
    // TODO Dependencies for AccountResource
    install(new DefaultOverdueModule(configSource));
}
Also used : NonEntityDaoModule(org.killbill.billing.util.glue.NonEntityDaoModule) DefaultEntitlementModule(org.killbill.billing.entitlement.glue.DefaultEntitlementModule) DefaultJaxrsModule(org.killbill.billing.jaxrs.glue.DefaultJaxrsModule) EventModule(org.killbill.billing.util.glue.EventModule) ConfigModule(org.killbill.billing.util.glue.ConfigModule) TemplateModule(org.killbill.billing.util.email.templates.TemplateModule) CacheModule(org.killbill.billing.util.glue.CacheModule) ExportModule(org.killbill.billing.util.glue.ExportModule) SecurityModule(org.killbill.billing.util.glue.SecurityModule) PaymentModule(org.killbill.billing.payment.glue.PaymentModule) DefaultOverdueModule(org.killbill.billing.overdue.glue.DefaultOverdueModule) CallContextModule(org.killbill.billing.util.glue.CallContextModule) DefaultInvoiceModule(org.killbill.billing.invoice.glue.DefaultInvoiceModule) DefaultSubscriptionModule(org.killbill.billing.subscription.glue.DefaultSubscriptionModule) TagStoreModule(org.killbill.billing.util.glue.TagStoreModule) KillbillApiAopModule(org.killbill.billing.util.glue.KillbillApiAopModule) CustomFieldModule(org.killbill.billing.util.glue.CustomFieldModule) DefaultAccountModule(org.killbill.billing.account.glue.DefaultAccountModule) BroadcastModule(org.killbill.billing.util.glue.BroadcastModule) CurrencyModule(org.killbill.billing.currency.glue.CurrencyModule) GlobalLockerModule(org.killbill.billing.util.glue.GlobalLockerModule) RecordIdModule(org.killbill.billing.util.glue.RecordIdModule) CatalogModule(org.killbill.billing.catalog.glue.CatalogModule) NodesModule(org.killbill.billing.util.glue.NodesModule) ConfigurationObjectFactory(org.skife.config.ConfigurationObjectFactory) BeatrixModule(org.killbill.billing.beatrix.glue.BeatrixModule) KillBillShiroAopModule(org.killbill.billing.util.glue.KillBillShiroAopModule) DefaultTenantModule(org.killbill.billing.tenant.glue.DefaultTenantModule) UsageModule(org.killbill.billing.usage.glue.UsageModule) AuditModule(org.killbill.billing.util.glue.AuditModule) DefaultJunctionModule(org.killbill.billing.junction.glue.DefaultJunctionModule) JaxrsConfig(org.killbill.billing.util.config.definition.JaxrsConfig)

Example 3 with KillBillShiroAopModule

use of org.killbill.billing.util.glue.KillBillShiroAopModule in project killbill by killbill.

the class TestPermissionAnnotationMethodInterceptor method testAOPForInterface.

@Test(groups = "fast")
public void testAOPForInterface() throws Exception {
    // Make sure it works as expected without any AOP magic
    final IAopTester simpleTester = new AopTesterImpl();
    try {
        simpleTester.createRefund();
    } catch (Exception e) {
        Assert.fail(e.getLocalizedMessage());
    }
    // Now, verify the interception works
    configureShiro();
    final Injector injector = Guice.createInjector(Stage.PRODUCTION, new ShiroModuleNoDB(configSource), new KillBillShiroAopModule(configSource), new TestSecurityModuleNoDB(configSource), new CacheModule(configSource), new AbstractModule() {

        @Override
        public void configure() {
            bind(IDBI.class).toInstance(Mockito.mock(IDBI.class));
            bind(IDBI.class).annotatedWith(Names.named(MAIN_RO_DATA_SOURCE_ID)).toInstance(Mockito.mock(IDBI.class));
            bind(IAopTester.class).to(AopTesterImpl.class).asEagerSingleton();
            bind(TenantInternalApi.class).toInstance(Mockito.mock(TenantInternalApi.class));
            bind(NonEntityDao.class).toInstance(Mockito.mock(NonEntityDao.class));
        }
    });
    final IAopTester aopedTester = injector.getInstance(IAopTester.class);
    verifyAopedTester(aopedTester);
}
Also used : TestSecurityModuleNoDB(org.killbill.billing.util.glue.TestSecurityModuleNoDB) IDBI(org.skife.jdbi.v2.IDBI) KillBillShiroAopModule(org.killbill.billing.util.glue.KillBillShiroAopModule) Injector(com.google.inject.Injector) CacheModule(org.killbill.billing.util.glue.CacheModule) ShiroModuleNoDB(org.killbill.billing.util.glue.TestUtilModuleNoDB.ShiroModuleNoDB) UnauthenticatedException(org.apache.shiro.authz.UnauthenticatedException) AuthorizationException(org.apache.shiro.authz.AuthorizationException) AbstractModule(com.google.inject.AbstractModule) Test(org.testng.annotations.Test)

Example 4 with KillBillShiroAopModule

use of org.killbill.billing.util.glue.KillBillShiroAopModule in project killbill by killbill.

the class TestPermissionAnnotationMethodInterceptor method testAOPForClass.

@Test(groups = "fast")
public void testAOPForClass() throws Exception {
    // Make sure it works as expected without any AOP magic
    final IAopTester simpleTester = new AopTester();
    try {
        simpleTester.createRefund();
    } catch (Exception e) {
        Assert.fail(e.getLocalizedMessage());
    }
    // Now, verify the interception works
    configureShiro();
    final Injector injector = Guice.createInjector(Stage.PRODUCTION, new ShiroModuleNoDB(configSource), new KillBillShiroAopModule(configSource), new TestSecurityModuleNoDB(configSource), new CacheModule(configSource), new AbstractModule() {

        @Override
        protected void configure() {
            bind(IDBI.class).toInstance(Mockito.mock(IDBI.class));
            bind(IDBI.class).annotatedWith(Names.named(MAIN_RO_DATA_SOURCE_ID)).toInstance(Mockito.mock(IDBI.class));
            bind(TenantInternalApi.class).toInstance(Mockito.mock(TenantInternalApi.class));
            bind(NonEntityDao.class).toInstance(Mockito.mock(NonEntityDao.class));
        }
    });
    final AopTester aopedTester = injector.getInstance(AopTester.class);
    verifyAopedTester(aopedTester);
}
Also used : TestSecurityModuleNoDB(org.killbill.billing.util.glue.TestSecurityModuleNoDB) IDBI(org.skife.jdbi.v2.IDBI) KillBillShiroAopModule(org.killbill.billing.util.glue.KillBillShiroAopModule) Injector(com.google.inject.Injector) CacheModule(org.killbill.billing.util.glue.CacheModule) ShiroModuleNoDB(org.killbill.billing.util.glue.TestUtilModuleNoDB.ShiroModuleNoDB) UnauthenticatedException(org.apache.shiro.authz.UnauthenticatedException) AuthorizationException(org.apache.shiro.authz.AuthorizationException) AbstractModule(com.google.inject.AbstractModule) Test(org.testng.annotations.Test)

Example 5 with KillBillShiroAopModule

use of org.killbill.billing.util.glue.KillBillShiroAopModule in project killbill by killbill.

the class KillbillServerModule method installKillbillModules.

protected void installKillbillModules() {
    install(new AuditModule(configSource));
    install(new NodesModule(configSource));
    install(new BroadcastModule(configSource));
    install(new BeatrixModule(configSource));
    install(new CacheModule(configSource));
    install(new ConfigModule(configSource));
    install(new EventModule(configSource));
    install(new CallContextModule(configSource));
    install(new CatalogModule(configSource));
    install(new CurrencyModule(configSource));
    install(new CustomFieldModule(configSource));
    install(new DefaultAccountModule(configSource));
    install(new DefaultEntitlementModule(configSource));
    install(new DefaultInvoiceModule(configSource));
    install(new DefaultJunctionModule(configSource));
    install(new DefaultOverdueModule(configSource));
    install(new DefaultSubscriptionModule(configSource));
    install(new ExportModule(configSource));
    install(new GlobalLockerModule(configSource));
    install(new KillBillShiroAopModule(configSource));
    final ConfigurationObjectFactory factory = new ConfigurationObjectFactory(skifeConfigSource);
    final JaxrsConfig jaxrsConfig = factory.build(JaxrsConfig.class);
    install(new KillbillApiAopModule(jaxrsConfig));
    install(new JaxRSAopModule(jaxrsConfig));
    install(new KillBillShiroWebModule(servletContext, skifeConfigSource));
    install(new NonEntityDaoModule(configSource));
    install(new PaymentModule(configSource));
    install(new RecordIdModule(configSource));
    install(new SecurityModule(configSource));
    install(new TagStoreModule(configSource));
    install(new TemplateModule(configSource));
    install(new DefaultTenantModule(configSource));
    install(new UsageModule(configSource));
    install(new DefaultJaxrsModule(configSource));
}
Also used : NonEntityDaoModule(org.killbill.billing.util.glue.NonEntityDaoModule) DefaultEntitlementModule(org.killbill.billing.entitlement.glue.DefaultEntitlementModule) DefaultJaxrsModule(org.killbill.billing.jaxrs.glue.DefaultJaxrsModule) EventModule(org.killbill.billing.util.glue.EventModule) ConfigModule(org.killbill.billing.util.glue.ConfigModule) TemplateModule(org.killbill.billing.util.email.templates.TemplateModule) CacheModule(org.killbill.billing.util.glue.CacheModule) ExportModule(org.killbill.billing.util.glue.ExportModule) SecurityModule(org.killbill.billing.util.glue.SecurityModule) PaymentModule(org.killbill.billing.payment.glue.PaymentModule) DefaultOverdueModule(org.killbill.billing.overdue.glue.DefaultOverdueModule) CallContextModule(org.killbill.billing.util.glue.CallContextModule) DefaultInvoiceModule(org.killbill.billing.invoice.glue.DefaultInvoiceModule) DefaultSubscriptionModule(org.killbill.billing.subscription.glue.DefaultSubscriptionModule) TagStoreModule(org.killbill.billing.util.glue.TagStoreModule) KillbillApiAopModule(org.killbill.billing.util.glue.KillbillApiAopModule) CustomFieldModule(org.killbill.billing.util.glue.CustomFieldModule) DefaultAccountModule(org.killbill.billing.account.glue.DefaultAccountModule) BroadcastModule(org.killbill.billing.util.glue.BroadcastModule) CurrencyModule(org.killbill.billing.currency.glue.CurrencyModule) GlobalLockerModule(org.killbill.billing.util.glue.GlobalLockerModule) RecordIdModule(org.killbill.billing.util.glue.RecordIdModule) CatalogModule(org.killbill.billing.catalog.glue.CatalogModule) NodesModule(org.killbill.billing.util.glue.NodesModule) ConfigurationObjectFactory(org.skife.config.ConfigurationObjectFactory) BeatrixModule(org.killbill.billing.beatrix.glue.BeatrixModule) KillBillShiroAopModule(org.killbill.billing.util.glue.KillBillShiroAopModule) DefaultTenantModule(org.killbill.billing.tenant.glue.DefaultTenantModule) UsageModule(org.killbill.billing.usage.glue.UsageModule) AuditModule(org.killbill.billing.util.glue.AuditModule) DefaultJunctionModule(org.killbill.billing.junction.glue.DefaultJunctionModule) JaxrsConfig(org.killbill.billing.util.config.definition.JaxrsConfig)

Aggregations

KillBillShiroAopModule (org.killbill.billing.util.glue.KillBillShiroAopModule)6 CacheModule (org.killbill.billing.util.glue.CacheModule)5 SecurityModule (org.killbill.billing.util.glue.SecurityModule)4 CallContextModule (org.killbill.billing.util.glue.CallContextModule)3 ConfigModule (org.killbill.billing.util.glue.ConfigModule)3 EventModule (org.killbill.billing.util.glue.EventModule)3 ShiroModuleNoDB (org.killbill.billing.util.glue.TestUtilModuleNoDB.ShiroModuleNoDB)3 AbstractModule (com.google.inject.AbstractModule)2 Injector (com.google.inject.Injector)2 AuthorizationException (org.apache.shiro.authz.AuthorizationException)2 UnauthenticatedException (org.apache.shiro.authz.UnauthenticatedException)2 DefaultAccountModule (org.killbill.billing.account.glue.DefaultAccountModule)2 BeatrixModule (org.killbill.billing.beatrix.glue.BeatrixModule)2 CatalogModule (org.killbill.billing.catalog.glue.CatalogModule)2 CurrencyModule (org.killbill.billing.currency.glue.CurrencyModule)2 DefaultEntitlementModule (org.killbill.billing.entitlement.glue.DefaultEntitlementModule)2 DefaultInvoiceModule (org.killbill.billing.invoice.glue.DefaultInvoiceModule)2 DefaultJaxrsModule (org.killbill.billing.jaxrs.glue.DefaultJaxrsModule)2 DefaultJunctionModule (org.killbill.billing.junction.glue.DefaultJunctionModule)2 DefaultOverdueModule (org.killbill.billing.overdue.glue.DefaultOverdueModule)2