Package org.jboss.ejb.client
Class StatefulEJBLocator<T>
- java.lang.Object
-
- org.jboss.ejb.client.EJBLocator<T>
-
- org.jboss.ejb.client.StatefulEJBLocator<T>
-
- Type Parameters:
T- the remote view type
- All Implemented Interfaces:
Serializable
public final class StatefulEJBLocator<T> extends EJBLocator<T>
A locator for a stateful session Enterprise Bean.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StatefulEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, String distinctName, SessionID sessionId)Construct a new instance.StatefulEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, String distinctName, SessionID sessionId, Affinity affinity)Construct a new instance.StatefulEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, SessionID sessionId)Construct a new instance.StatefulEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, SessionID sessionId, Affinity affinity)Construct a new instance.StatefulEJBLocator(Class<T> viewType, EJBIdentifier identifier, SessionID sessionId)Construct a new instance.StatefulEJBLocator(Class<T> viewType, EJBIdentifier identifier, SessionID sessionId, Affinity affinity)Construct a new instance.StatefulEJBLocator(EJBLocator<T> original, SessionID sessionId)Construct a new instance.StatefulEJBLocator(EJBLocator<T> original, SessionID sessionId, Affinity newAffinity)Construct a new instance.StatefulEJBLocator(StatefulEJBLocator<T> original, Affinity newAffinity)Construct a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StatefulEJBLocator<T>asStateful()Return this locator as a stateful locator, if it is one.static <T> StatefulEJBLocator<T>create(Class<T> viewType, EJBIdentifier identifier, SessionID sessionId, Affinity affinity)Construct a new instance.booleanequals(Object other)Determine whether this object is equal to another.booleanequals(EJBLocator<?> other)Determine whether this object is equal to another.booleanequals(StatefulEJBLocator<?> other)Determine whether this object is equal to another.SessionIDgetSessionId()Get the session ID associated with this locator.booleanisStateful()Determine if this is a stateful locator.<S> StatefulEJBLocator<? extends S>narrowAsStateful(Class<S> type)Narrow this locator to the target type as a stateful locator.<S> StatefulEJBLocator<? extends S>narrowTo(Class<S> type)Narrow this locator to the target type.StringtoString()StatefulEJBLocator<T>withNewAffinity(Affinity affinity)Create a copy of this locator, but with the new given affinity.StatelessEJBLocator<T>withoutSession()Get a copy of this stateful Enterprise Beans locator, but without any session ID.StatefulEJBLocator<T>withSession(SessionID sessionId)Create a copy of this locator, but with the given stateful session ID.StatefulEJBLocator<T>withSessionAndAffinity(SessionID sessionId, Affinity affinity)Create a copy of this locator, but with the given affinity and stateful session ID.-
Methods inherited from class org.jboss.ejb.client.EJBLocator
asStateless, canNarrowTo, createProxyInstance, getAffinity, getAppName, getBeanName, getDistinctName, getIdentifier, getModuleName, getProxyClass, getProxyConstructor, getViewType, hashCode, isEntity, isHome, isStateless, narrowAsEntity, narrowAsHome, narrowAsStateless
-
-
-
-
Constructor Detail
-
StatefulEJBLocator
public StatefulEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, SessionID sessionId)
Construct a new instance.- Parameters:
viewType- the view typeappName- the application namemoduleName- the module namebeanName- the bean namesessionId- the stateful session ID
-
StatefulEJBLocator
public StatefulEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, SessionID sessionId, Affinity affinity)
Construct a new instance.- Parameters:
viewType- the view typeappName- the application namemoduleName- the module namebeanName- the bean namesessionId- the stateful session IDaffinity- TheAffinityfor this stateful bean locator
-
StatefulEJBLocator
public StatefulEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, String distinctName, SessionID sessionId)
Construct a new instance.- Parameters:
viewType- the view typeappName- the application namemoduleName- the module namebeanName- the bean namedistinctName- the distinct namesessionId- the stateful session ID
-
StatefulEJBLocator
public StatefulEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, String distinctName, SessionID sessionId, Affinity affinity)
Construct a new instance.- Parameters:
viewType- the view typeappName- the application namemoduleName- the module namebeanName- the bean namedistinctName- the distinct namesessionId- the stateful session IDaffinity- TheAffinityfor this stateful bean locator
-
StatefulEJBLocator
public StatefulEJBLocator(Class<T> viewType, EJBIdentifier identifier, SessionID sessionId, Affinity affinity)
Construct a new instance.- Parameters:
viewType- the view typeidentifier- the Enterprise Beans identifiersessionId- the stateful session IDaffinity- theAffinityfor this stateful bean locator
-
StatefulEJBLocator
public StatefulEJBLocator(Class<T> viewType, EJBIdentifier identifier, SessionID sessionId)
Construct a new instance.- Parameters:
viewType- the view typeidentifier- the Enterprise Beans identifiersessionId- the stateful session ID
-
StatefulEJBLocator
public StatefulEJBLocator(StatefulEJBLocator<T> original, Affinity newAffinity)
Construct a new instance. This constructor creates a copy of the original locator, but with a new affinity.- Parameters:
original- the original locatornewAffinity- the new affinity
-
StatefulEJBLocator
public StatefulEJBLocator(EJBLocator<T> original, SessionID sessionId)
Construct a new instance. This constructor uses the location from the original locator, but with the given session ID.- Parameters:
original- the original locatorsessionId- the session ID
-
StatefulEJBLocator
public StatefulEJBLocator(EJBLocator<T> original, SessionID sessionId, Affinity newAffinity)
Construct a new instance. This constructor uses the location from the original locator, but with the given session ID and affinity.- Parameters:
original- the original locatorsessionId- the session IDnewAffinity- the new affinity
-
-
Method Detail
-
create
public static <T> StatefulEJBLocator<T> create(Class<T> viewType, EJBIdentifier identifier, SessionID sessionId, Affinity affinity)
Construct a new instance.- Type Parameters:
T- the remote view type- Parameters:
viewType- the view type (must not benull)identifier- the Enterprise Beans identifier (must not benull)sessionId- the stateful session ID (must not benull)affinity- theAffinityfor this stateful bean locator- Returns:
- the new instance (not
null)
-
withoutSession
public StatelessEJBLocator<T> withoutSession()
Get a copy of this stateful Enterprise Beans locator, but without any session ID.- Returns:
- the stateless Enterprise Beans locator (not
null)
-
withSession
public StatefulEJBLocator<T> withSession(SessionID sessionId)
Description copied from class:EJBLocatorCreate a copy of this locator, but with the given stateful session ID. If this locator cannot be converted, an exception is thrown.- Overrides:
withSessionin classEJBLocator<T>- Parameters:
sessionId- the stateful session ID (must not benull)- Returns:
- the new locator (not
null)
-
withNewAffinity
public StatefulEJBLocator<T> withNewAffinity(Affinity affinity)
Description copied from class:EJBLocatorCreate a copy of this locator, but with the new given affinity.- Specified by:
withNewAffinityin classEJBLocator<T>- Parameters:
affinity- the new affinity- Returns:
- the new locator
-
withSessionAndAffinity
public StatefulEJBLocator<T> withSessionAndAffinity(SessionID sessionId, Affinity affinity)
Description copied from class:EJBLocatorCreate a copy of this locator, but with the given affinity and stateful session ID. If this locator cannot be converted, an exception is thrown.- Overrides:
withSessionAndAffinityin classEJBLocator<T>- Parameters:
sessionId- the stateful session ID (must not benull)affinity- the new affinity (must not benull)- Returns:
- the new locator (not
null)
-
narrowTo
public <S> StatefulEJBLocator<? extends S> narrowTo(Class<S> type)
Description copied from class:EJBLocatorNarrow this locator to the target type.- Overrides:
narrowToin classEJBLocator<T>- Type Parameters:
S- the target type- Parameters:
type- the target type class- Returns:
- this instance, narrowed to the given type
-
narrowAsStateful
public <S> StatefulEJBLocator<? extends S> narrowAsStateful(Class<S> type)
Description copied from class:EJBLocatorNarrow this locator to the target type as a stateful locator.- Overrides:
narrowAsStatefulin classEJBLocator<T>- Type Parameters:
S- the target type- Parameters:
type- the target type class- Returns:
- this instance, narrowed to the given type and cast as a stateful locator
-
asStateful
public StatefulEJBLocator<T> asStateful()
Description copied from class:EJBLocatorReturn this locator as a stateful locator, if it is one.- Overrides:
asStatefulin classEJBLocator<T>- Returns:
- this instance, cast as a stateful locator
-
isStateful
public boolean isStateful()
Description copied from class:EJBLocatorDetermine if this is a stateful locator. If so, calls toEJBLocator.asStateful()andEJBLocator.narrowAsStateful(Class)will generally succeed.- Overrides:
isStatefulin classEJBLocator<T>- Returns:
trueif this locator is stateful,falseotherwise
-
getSessionId
public SessionID getSessionId()
Get the session ID associated with this locator.- Returns:
- the session ID
-
equals
public boolean equals(Object other)
Determine whether this object is equal to another.- Overrides:
equalsin classEJBLocator<T>- Parameters:
other- the other object- Returns:
trueif they are equal,falseotherwise
-
equals
public boolean equals(EJBLocator<?> other)
Determine whether this object is equal to another.- Overrides:
equalsin classEJBLocator<T>- Parameters:
other- the other object- Returns:
trueif they are equal,falseotherwise
-
equals
public boolean equals(StatefulEJBLocator<?> other)
Determine whether this object is equal to another.- Parameters:
other- the other object- Returns:
trueif they are equal,falseotherwise
-
toString
public String toString()
- Overrides:
toStringin classEJBLocator<T>
-
-