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
A locator for a stateful session Enterprise Bean.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionStatefulEJBLocator(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
Modifier and TypeMethodDescriptionReturn 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.booleanDetermine 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.Get the session ID associated with this locator.booleanDetermine 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>Narrow this locator to the target type.toString()withNewAffinity(Affinity affinity) Create a copy of this locator, but with the new given affinity.Get a copy of this stateful Enterprise Beans locator, but without any session ID.withSession(SessionID sessionId) Create a copy of this locator, but with the given stateful session ID.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 Details
-
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
Construct a new instance.- Parameters:
viewType- the view typeidentifier- the Enterprise Beans identifiersessionId- the stateful session ID
-
StatefulEJBLocator
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
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
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 Details
-
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
Get a copy of this stateful Enterprise Beans locator, but without any session ID.- Returns:
- the stateless Enterprise Beans locator (not
null)
-
withSession
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
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
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
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
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
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
Get the session ID associated with this locator.- Returns:
- the session ID
-
equals
Determine whether this object is equal to another.- Overrides:
equalsin classEJBLocator<T>- Parameters:
other- the other object- Returns:
trueif they are equal,falseotherwise
-
equals
Determine whether this object is equal to another.- Overrides:
equalsin classEJBLocator<T>- Parameters:
other- the other object- Returns:
trueif they are equal,falseotherwise
-
equals
Determine whether this object is equal to another.- Parameters:
other- the other object- Returns:
trueif they are equal,falseotherwise
-
toString
- Overrides:
toStringin classEJBLocator<T>
-