@Override public ServiceDeclaration setMetaInfo( Object serviceAttribute ) { for( ServiceDeclaration declaration : declarations ) { declaration.setMetaInfo( serviceAttribute ); } return this; }
public void to( ModuleAssembly module ) throws AssemblyException { // TODO Refactor adding Map<ServiceAssembly,T> ServiceDeclaration.getMetaInfos( Class<T> type ); in bootstrap & runtime // This would allow removing the ConstraintServices instances and this horrible hack with random UUIDs for ( ConstraintAssembler eachAssembler : constraintAssemblers ) { module.addServices( ConstraintService.class ).identifiedBy( UUID.randomUUID().toString() ).setMetaInfo( eachAssembler.constraintInfo() ); } }
public void to( ModuleAssembly module ) throws AssemblyException { // TODO Refactor adding Map<ServiceAssembly,T> ServiceDeclaration.getMetaInfos( Class<T> type ); in bootstrap & runtime // This would allow removing the ConstraintServices instances and this horrible hack with random UUIDs for ( ConstraintAssembler eachAssembler : constraintAssemblers ) { module.addServices( ConstraintService.class ).identifiedBy( UUID.randomUUID().toString() ).setMetaInfo( eachAssembler.constraintInfo() ); } }
public void to( ModuleAssembly module ) throws AssemblyException { for ( ContextListenerDeclaration contextListenerDeclaration : contextListenerDeclarations ) { module.services( contextListenerDeclaration.contextListener() ). setMetaInfo( contextListenerDeclaration.contextListenerInfo() ). instantiateOnStartup().visibleIn( layer ); } }
public void to( ModuleAssembly module ) throws AssemblyException { for ( ContextListenerDeclaration contextListenerDeclaration : contextListenerDeclarations ) { module.services( contextListenerDeclaration.contextListener() ). setMetaInfo( contextListenerDeclaration.contextListenerInfo() ). instantiateOnStartup().visibleIn( layer ); } }
@Override // START SNIPPET: import public void assemble( ModuleAssembly module ) throws AssemblyException { BundleContext bundleContext = // END SNIPPET: import null; // START SNIPPET: import module.services( OSGiServiceImporter.class ). setMetaInfo( new OSGiImportInfo( bundleContext, MyOSGiService.class, MyOtherOSGiService.class ) ). setMetaInfo( new MyFallbackStrategy() ); } // END SNIPPET: import
@SuppressWarnings( "unchecked" ) public void to( ModuleAssembly module ) throws AssemblyException { for ( FilterAssembler filterAssembler : filterAssemblers ) { module.services( filterAssembler.filter() ). setMetaInfo( filterAssembler.filterInfo() ). instantiateOnStartup().visibleIn( layer ); } }
public void to( ModuleAssembly module ) throws AssemblyException { for ( ServletDeclaration servletDeclaration : servletDeclarations ) { module.services( servletDeclaration.servlet() ). setMetaInfo( servletDeclaration.servletInfo() ). instantiateOnStartup().visibleIn( layer ); } }
@Override public void assemble( ModuleAssembly module ) throws AssemblyException { module.services( MyService.class ).setMetaInfo( bundleContext ).instantiateOnStartup(); }
public void to( ModuleAssembly module ) throws AssemblyException { for ( ServletDeclaration servletDeclaration : servletDeclarations ) { module.services( servletDeclaration.servlet() ). setMetaInfo( servletDeclaration.servletInfo() ). instantiateOnStartup().visibleIn( layer ); } }
@SuppressWarnings( "unchecked" ) public void to( ModuleAssembly module ) throws AssemblyException { for ( FilterAssembler filterAssembler : filterAssemblers ) { module.services( filterAssembler.filter() ). setMetaInfo( filterAssembler.filterInfo() ). instantiateOnStartup().visibleIn( layer ); } }
public void assemble( ModuleAssembly module ) throws AssemblyException { module.services( TestService.class ).setMetaInfo( new CircuitBreaker() ); } // END SNIPPET: service
@Override // START SNIPPET: export public void assemble( ModuleAssembly module ) throws AssemblyException { BundleContext bundleContext = // ... // END SNIPPET: export null; // START SNIPPET: export module.services( OSGiServiceExporter.class ). setMetaInfo( bundleContext ); module.services( MyPolygeneService.class ); } // END SNIPPET: export
@Override public void assemble( ModuleAssembly module ) throws AssemblyException { module.services( MyService.class ).instantiateOnStartup(); module.services( MyService.class ).setMetaInfo( "Hello" ); }
public void assemble( ModuleAssembly module ) throws AssemblyException { testInfo = new TestInfo(); module.services( MyService.class ).setMetaInfo( testInfo ).instantiateOnStartup(); }
@Override public void assemble( ModuleAssembly module ) { super.assemble( module ); ServiceDeclaration service = module.services( FileConfigurationService.class ).visibleIn( visibility() ); if( hasIdentity() ) { service.identifiedBy( identity() ); } if( override != null ) { service.setMetaInfo( override ); } } }
@Override public void assemble( ModuleAssembly module ) { super.assemble( module ); ServiceDeclaration service = module.services( FileConfigurationService.class ).visibleIn( visibility() ); if( hasIdentity() ) { service.identifiedBy( identity() ); } if( override != null ) { service.setMetaInfo( override ); } } }
@Override public void assemble( ModuleAssembly module ) { super.assemble( module ); ServiceDeclaration service = module.services( CodahaleMetricsProvider.class ) .setMetaInfo( declaration ) .instantiateOnStartup() .identifiedBy( identity() ) .visibleIn( visibility() ); if( hasIdentity() ) { service.identifiedBy( identity() ); } } }
@Override public void assemble( ModuleAssembly module ) throws AssemblyException { module.services( TestAlarmModel1.class ).setMetaInfo( new AlarmModelDescriptor("Simple", false) ); module.services( TestAlarmModel2.class ).setMetaInfo( new AlarmModelDescriptor("Standard", true) ); module.services( AlarmSystemService.class ); module.entities( AlarmPointEntity.class ); module.values( AlarmStatus.class ); module.values( AlarmCategory.class ); module.values( AlarmEvent.class ); new EntityTestAssembler().assemble( module ); }
@Test public void testInjectionServiceBetweenModules() throws ActivationException { SingletonAssembler assembly = new SingletonAssembler( module -> { module.services( MyServiceComposite.class ) .identifiedBy( "Foo" ) .setMetaInfo( new ServiceName( "Foo" ) ); module.services( StringService.class, LongService.class ); module.objects( ServiceUser.class ); ModuleAssembly module2 = module.layer().module( "Other module" ); ServiceDeclaration service2Decl = module2.services( MyServiceComposite.class ); service2Decl.identifiedBy( "Bar" ).setMetaInfo( new ServiceName( "Bar" ) ).visibleIn( layer ); ServiceDeclaration service3Decl = module2.services( MyServiceComposite2.class ); service3Decl.identifiedBy( "Boo" ).setMetaInfo( new ServiceName( "Boo" ) ); } ); testInjection( assembly ); }