TorqueBox 3.1.2

org.torquebox.core.injection.analysis
Class InjectableHandlerRegistry

java.lang.Object
  extended by org.torquebox.core.injection.analysis.InjectableHandlerRegistry
All Implemented Interfaces:
org.jboss.msc.service.Service<InjectableHandlerRegistry>, org.jboss.msc.value.Value<InjectableHandlerRegistry>

public class InjectableHandlerRegistry
extends Object
implements org.jboss.msc.service.Service<InjectableHandlerRegistry>

Registry of handlers for the content of inject(...) calls.

Handlers are added to the registry through the Java service loader mechanism.

To add a handler, package it in a jar with file named META-INF/org.torquebox.core.injection.analysis.InjectableHandler whose contents is the names (1 per line) of InjectableHandler implementations.

Author:
Bob McWhirter
See Also:
InjectableHandler

Field Summary
 
Fields inherited from interface org.jboss.msc.service.Service
NULL, NULL_VALUE
 
Constructor Summary
InjectableHandlerRegistry()
           
 
Method Summary
 void addInjectableHandler(InjectableHandler handler)
           
 InjectableHandler getHandler(Object injection)
          Retrieve a handler by its compatibility with the argument.
 InjectableHandler getHandlerForType(String type)
          Retrieve a handler by its registered type.
 Set<Injectable> getPredeterminedInjectables()
          Retrieve the full set of predetermined Injectable.
 InjectableHandlerRegistry getValue()
           
 void start(org.jboss.msc.service.StartContext context)
           
 void stop(org.jboss.msc.service.StopContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InjectableHandlerRegistry

public InjectableHandlerRegistry()
Method Detail

addInjectableHandler

public void addInjectableHandler(InjectableHandler handler)

getHandlerForType

public InjectableHandler getHandlerForType(String type)
Retrieve a handler by its registered type.

Parameters:
type - The type.
Returns:
The handler, or null if none match the type.

getHandler

public InjectableHandler getHandler(Object injection)
Retrieve a handler by its compatibility with the argument.

Parameters:
injection - The injection string.
Returns:
The handler or null if none are compatible.

getPredeterminedInjectables

public Set<Injectable> getPredeterminedInjectables()
Retrieve the full set of predetermined Injectable.

Returns:
The predetermined injectables.

getValue

public InjectableHandlerRegistry getValue()
                                   throws IllegalStateException,
                                          IllegalArgumentException
Specified by:
getValue in interface org.jboss.msc.value.Value<InjectableHandlerRegistry>
Throws:
IllegalStateException
IllegalArgumentException

start

public void start(org.jboss.msc.service.StartContext context)
           throws org.jboss.msc.service.StartException
Specified by:
start in interface org.jboss.msc.service.Service<InjectableHandlerRegistry>
Throws:
org.jboss.msc.service.StartException

stop

public void stop(org.jboss.msc.service.StopContext context)
Specified by:
stop in interface org.jboss.msc.service.Service<InjectableHandlerRegistry>

TorqueBox 3.1.2

Copyright © 2015 JBoss by Red Hat. All Rights Reserved.