org.jboss.ejb3.common.registrar.plugin.mc
Class Ejb3McRegistrar

java.lang.Object
  extended by org.jboss.ejb3.common.registrar.plugin.mc.Ejb3McRegistrar
All Implemented Interfaces:
Ejb3Registrar

public class Ejb3McRegistrar
extends Object
implements Ejb3Registrar

Ejb3McRegistrar Microcontainer-based Implementation of the Ejb3Registrar

Version:
$Revision: $
Author:
ALR
See Also:
Ejb3Registrar}

Constructor Summary
Ejb3McRegistrar(org.jboss.kernel.Kernel kernel)
           
 
Method Summary
 void bind(Object name, Object value)
          Binds the specified value to the key of specified name, throwing a DuplicateBindException in the case the name is not unique
 org.jboss.kernel.Kernel getProvider()
          Returns a provider implementation-specific class to break contract and invoke upon vendor-specific features.
 Object invoke(Object name, String methodName, Object[] arguments, String[] signature)
          Invokes the specified method name on the object bound at the specified name, returning the result
 Map<Object,Object> list()
          Lists out all installed (bound) objects in form key == name , value == object.
 Object lookup(Object name)
          Obtains the value bound at the specified name, throwing NotBoundException if there is nothing bound at the key
 Object lookup(Object name, boolean checkInstalled)
          Obtains the value bound at the specified name, throwing NotBoundException if there is nothing bound at the key.
<T> T
lookup(Object name, Class<T> type)
          Obtains the value bound at the specified name, throwing NotBoundException if there is nothing bound at the key.
 void rebind(Object name, Object value)
          Binds the specified value to the key of specified name, optionally unbinding the current value if one exists
 void unbind(Object name)
          Unbinds the object at the specified name, throwing NotBoundException if no object exists at that name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ejb3McRegistrar

public Ejb3McRegistrar(org.jboss.kernel.Kernel kernel)
Method Detail

list

public Map<Object,Object> list()
Lists out all installed (bound) objects in form key == name , value == object. Primarily for metrics/debugging/management. If nothing is installed, an empty Map will be returned. The returned Map is immutable.

Specified by:
list in interface Ejb3Registrar
Returns:

lookup

public Object lookup(Object name)
              throws NotBoundException
Obtains the value bound at the specified name, throwing NotBoundException if there is nothing bound at the key

Specified by:
lookup in interface Ejb3Registrar
Parameters:
name -
Returns:
Throws:
NotBoundException

lookup

public Object lookup(Object name,
                     boolean checkInstalled)
              throws NotBoundException
Obtains the value bound at the specified name, throwing NotBoundException if there is nothing bound at the key. If the "checkInstalled" flag is true, this implementation will also ensure that the lookup value is of ControllerState.INSTALLED, else NotBoundException

Parameters:
name -
checkInstalled -
Returns:
Throws:
NotBoundException

lookup

public <T> T lookup(Object name,
                    Class<T> type)
         throws NotBoundException
Obtains the value bound at the specified name, throwing NotBoundException if there is nothing bound at the key. The value returned will be automatically casted to the specified type.

Specified by:
lookup in interface Ejb3Registrar
Type Parameters:
T -
Parameters:
name -
type -
Returns:
Throws:
NotBoundException

bind

public void bind(Object name,
                 Object value)
          throws DuplicateBindException
Binds the specified value to the key of specified name, throwing a DuplicateBindException in the case the name is not unique

Specified by:
bind in interface Ejb3Registrar
Parameters:
name -
value -
Throws:
DuplicateBindException

rebind

public void rebind(Object name,
                   Object value)
Binds the specified value to the key of specified name, optionally unbinding the current value if one exists

Specified by:
rebind in interface Ejb3Registrar
Parameters:
name -
value -

unbind

public void unbind(Object name)
            throws NotBoundException
Unbinds the object at the specified name, throwing NotBoundException if no object exists at that name

Specified by:
unbind in interface Ejb3Registrar
Parameters:
name -
Throws:
NotBoundException

getProvider

public org.jboss.kernel.Kernel getProvider()
Returns a provider implementation-specific class to break contract and invoke upon vendor-specific features.

Specified by:
getProvider in interface Ejb3Registrar
Returns:

invoke

public Object invoke(Object name,
                     String methodName,
                     Object[] arguments,
                     String[] signature)
              throws NotBoundException
Invokes the specified method name on the object bound at the specified name, returning the result

Specified by:
invoke in interface Ejb3Registrar
Parameters:
name -
methodName -
arguments - Arguments to pass to the method
signature - String representation of fully-qualified class names of parameter types
Returns:
Throws:
NotBoundException - If no object is bound at the specified name


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.