org.jboss.beans.metadata.plugins
Class FromContext<T extends org.jboss.dependency.spi.ControllerContext>

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.beans.metadata.plugins.FromContext<T>
Type Parameters:
T - exact controller context type
All Implemented Interfaces:
Serializable, Cloneable, org.jboss.util.JBossInterface

public abstract class FromContext<T extends org.jboss.dependency.spi.ControllerContext>
extends org.jboss.util.JBossObject
implements Serializable

Inject from controller context: * name - controller context name * aliases - aliases * metadata - inject MetaData * beaninfo - BeanInfo * scope - ScopeKey * id - identifier * dynamic - method specific * ...

Author:
Ales Justin
See Also:
Serialized Form

Field Summary
static FromContext ALIASES
          alias
static FromContext BEANINFO
          beaninfo
static FromContext CONTEXT
          context
protected  String fromString
          The type string
static FromContext ID
          id
static FromContext METADATA
          metadata
static FromContext NAME
          name
static FromContext SCOPE
          scope
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Constructor Summary
protected FromContext(String fromString)
          Create a new state
 
Method Summary
 boolean equals(Object object)
           
 Object executeLookup(org.jboss.dependency.spi.ControllerContext context)
          Execute injection on context.
 String getFromString()
          Get the from string
protected  int getHashCode()
           
static FromContext getInstance(String fromString)
          Return from type.
abstract  Object internalExecute(T context)
          Execute internal lookup on context.
 void toString(org.jboss.util.JBossStringBuilder buffer)
           
protected  void validate(org.jboss.dependency.spi.ControllerContext context)
          Validate context before execution.
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, hashCode, list, notEqual, toShortString, toShortString, toString, toStringImplementation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final FromContext NAME
name


ALIASES

public static final FromContext ALIASES
alias


METADATA

public static final FromContext METADATA
metadata


BEANINFO

public static final FromContext BEANINFO
beaninfo


SCOPE

public static final FromContext SCOPE
scope


ID

public static final FromContext ID
id


CONTEXT

public static final FromContext CONTEXT
context


fromString

protected final String fromString
The type string

Constructor Detail

FromContext

protected FromContext(String fromString)
Create a new state

Parameters:
fromString - the string representation
Method Detail

getInstance

public static FromContext getInstance(String fromString)
Return from type.

Parameters:
fromString - type
Returns:
FromContext instance

validate

protected void validate(org.jboss.dependency.spi.ControllerContext context)
Validate context before execution. After validation we must be able to cast context to T instance.

Parameters:
context - the context

executeLookup

public Object executeLookup(org.jboss.dependency.spi.ControllerContext context)
                     throws Throwable
Execute injection on context.

Parameters:
context - the target context
Returns:
lookup value
Throws:
Throwable - for any error

internalExecute

public abstract Object internalExecute(T context)
                                throws Throwable
Execute internal lookup on context.

Parameters:
context - the target context
Returns:
lookup value
Throws:
Throwable - for any error

getFromString

public String getFromString()
Get the from string

Returns:
the state string

equals

public boolean equals(Object object)
Overrides:
equals in class Object

toString

public void toString(org.jboss.util.JBossStringBuilder buffer)
Overrides:
toString in class org.jboss.util.JBossObject

getHashCode

protected int getHashCode()
Overrides:
getHashCode in class org.jboss.util.JBossObject


Copyright ? 2007 JBoss Inc.. All Rights Reserved.