Refine search
@ApplicationScoped static class RegistryListenerAdapter implements RegistryListener { @Inject @Any Event<RemoteDeviceDiscovery> remoteDeviceDiscoveryEvent; @Inject @Any Event<FailedRemoteDeviceDiscovery> failedRemoteDeviceDiscoveryEvent; @Inject @Any Event<LocalDeviceDiscovery> localDeviceDiscoveryEvent; @Inject @Any Event<RegistryShutdown> registryShutdownEvent;
@Post @ApplicationScoped public class RemoteNamingCustomizer implements Customizer { @Inject @Any Instance<NamingFraction> namingInstance; @Override public void customize() { if (!namingInstance.isUnsatisfied()) { namingInstance.get().remoteNamingService(); } } }
@Produces @ApplicationScoped public IndexersFactory getIndexersFactory(@Any Instance<Indexer> indexers) { IndexersFactory factory = new IndexersFactory(); getIndexers(indexers).forEach(factory::addIndexer); return factory; }
@Post @ApplicationScoped public class RemoteMessagingCustomizer implements Customizer { @Inject @Any Instance<MessagingFraction> messagingInstance; @Override public void customize() { if (!messagingInstance.isUnsatisfied()) { messagingInstance.get().defaultServer(EnhancedServer::enableRemote); } } }
@ApplicationScoped static class RegistryListenerAdapter implements RegistryListener { @Inject @Any Event<RemoteDeviceDiscovery> remoteDeviceDiscoveryEvent; @Inject @Any Event<FailedRemoteDeviceDiscovery> failedRemoteDeviceDiscoveryEvent; @Inject @Any Event<LocalDeviceDiscovery> localDeviceDiscoveryEvent; @Inject @Any Event<RegistryShutdown> registryShutdownEvent;
/** * @author Bob McWhirter */ @Post @ApplicationScoped public class EarlyLoggingCustomizer implements Customizer { @Inject @Any private LoggingFraction fraction; @Override public void customize() { for (Logger logger : fraction.subresources().loggers()) { java.util.logging.Logger l = LogManager.getLogManager().getLogger(logger.getKey()); l.setLevel(java.util.logging.Level.parse(logger.level().toString())); } } }
/** * * @author <a href="mailto:manovotn@redhat.com">Matej Novotny</a> */ @ApplicationScoped public class Warehouse { @Inject @Any Box box; public void pokeBox() { box.breaks(); } }
@Post @ApplicationScoped public class ODataWarDeploymentProducer { @Inject @Any ODataFraction fraction; @Produces public Archive odataWar() throws Exception { WARArchive war = ShrinkWrap.create(WARArchive.class, "odata.war") .setContextRoot(this.fraction.getContext()) .setWebXML(this.getClass().getResource("/web.xml")); war.addModule("org.jboss.teiid.olingo"); if (this.fraction.isSecure()) { war.as(Secured.class).protect().withRole(fraction.getRole()); } return war; } }
@ApplicationScoped public class SocialAdapterRepository implements SocialAdapterRepositoryAPI { private Map<Class, SocialAdapter> socialAdapters = new HashMap<Class, SocialAdapter>(); @Inject @Any private Instance<SocialAdapter<?>> services; @PostConstruct public void setup() { for ( SocialAdapter bean : services ) { socialAdapters.put( bean.eventToIntercept(), bean ); } } @Override public Map<Class, SocialAdapter> getSocialAdapters() { return socialAdapters; } }
/** * @author Bob McWhirter */ @Post @ApplicationScoped public class LoggingCustomizer implements Customizer { @Inject @Any private LoggingFraction fraction; @Override public void customize() { LevelNode root = InitialLoggerManager.INSTANCE.getRoot(); apply(root); } private void apply(LevelNode node) { if (!node.getName().equals("")) { this.fraction.logger(node.getName(), (l) -> { l.level(Level.valueOf(node.getLevel().toString())); }); } for (LevelNode each : node.getChildren()) { apply(each); } } }