Package org.jboss.ejb.client
Class StatelessEJBLocator<T>
- java.lang.Object
-
- org.jboss.ejb.client.EJBLocator<T>
-
- org.jboss.ejb.client.StatelessEJBLocator<T>
-
- Type Parameters:
T
- the remote view type
- All Implemented Interfaces:
Serializable
public final class StatelessEJBLocator<T> extends EJBLocator<T>
A locator for a stateless session EJB.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StatelessEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName)
Construct a new instance.StatelessEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, String distinctName)
Construct a new instance.StatelessEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, String distinctName, Affinity affinity)
Construct a new instance.StatelessEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, Affinity affinity)
Construct a new instance.StatelessEJBLocator(Class<T> viewType, EJBIdentifier identifier)
Construct a new instance.StatelessEJBLocator(Class<T> viewType, EJBIdentifier identifier, Affinity affinity)
Construct a new instance.StatelessEJBLocator(StatelessEJBLocator<T> original, Affinity newAffinity)
Construct a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StatelessEJBLocator<T>
asStateless()
Return this locator as a stateless locator, if it is one.static <T> StatelessEJBLocator<T>
create(Class<T> viewType, EJBIdentifier identifier, Affinity affinity)
Construct a new instance.static <T> StatelessEJBLocator<T>
create(EJBLocator<T> original, Affinity newAffinity)
Construct a new instance.boolean
equals(Object other)
Determine whether this object is equal to another.boolean
equals(EJBLocator<?> other)
Determine whether this object is equal to another.boolean
equals(StatelessEJBLocator<?> other)
Determine whether this object is equal to another.boolean
isStateless()
Determine if this is a stateless locator.<S> StatelessEJBLocator<? extends S>
narrowAsStateless(Class<S> type)
Narrow this locator to the target type as a stateless locator.<S> StatelessEJBLocator<? extends S>
narrowTo(Class<S> type)
Narrow this locator to the target type.StatelessEJBLocator<T>
withNewAffinity(Affinity affinity)
Create a copy of this locator, but with the new given affinity.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
asStateful, canNarrowTo, createProxyInstance, getAffinity, getAppName, getBeanName, getDistinctName, getIdentifier, getModuleName, getProxyClass, getProxyConstructor, getViewType, hashCode, isEntity, isHome, isStateful, narrowAsEntity, narrowAsHome, narrowAsStateful, toString
-
-
-
-
Constructor Detail
-
StatelessEJBLocator
public StatelessEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName)
Construct a new instance.- Parameters:
viewType
- the view typeappName
- the application namemoduleName
- the module namebeanName
- the bean name
-
StatelessEJBLocator
public StatelessEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, Affinity affinity)
Construct a new instance.- Parameters:
viewType
- the view typeappName
- the application namemoduleName
- the module namebeanName
- the bean nameaffinity
- the affinity
-
StatelessEJBLocator
public StatelessEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, String distinctName)
Construct a new instance.- Parameters:
viewType
- the view typeappName
- the application namemoduleName
- the module namebeanName
- the bean namedistinctName
- the distinct name
-
StatelessEJBLocator
public StatelessEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, String distinctName, Affinity affinity)
Construct a new instance.- Parameters:
viewType
- the view typeappName
- the application namemoduleName
- the module namebeanName
- the bean namedistinctName
- the distinct nameaffinity
- the affinity
-
StatelessEJBLocator
public StatelessEJBLocator(Class<T> viewType, EJBIdentifier identifier, Affinity affinity)
Construct a new instance.- Parameters:
viewType
- the view typeidentifier
- the EJB identifieraffinity
- the affinity
-
StatelessEJBLocator
public StatelessEJBLocator(Class<T> viewType, EJBIdentifier identifier)
Construct a new instance.- Parameters:
viewType
- the view typeidentifier
- the EJB identifier
-
StatelessEJBLocator
public StatelessEJBLocator(StatelessEJBLocator<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
-
-
Method Detail
-
create
public static <T> StatelessEJBLocator<T> create(Class<T> viewType, EJBIdentifier identifier, Affinity affinity)
Construct a new instance.- Type Parameters:
T
- the remote view type- Parameters:
viewType
- the view type (must not benull
)identifier
- the EJB identifier (must not benull
)affinity
- theAffinity
for this stateful bean locator- Returns:
- the new instance (not
null
)
-
create
public static <T> StatelessEJBLocator<T> create(EJBLocator<T> original, Affinity newAffinity)
Construct a new instance. This method uses the location from the original locator, but with the given session ID and affinity.- Type Parameters:
T
- the remote view type- Parameters:
original
- the original locator (must not benull
)newAffinity
- the new affinity- Returns:
- the new instance (not
null
)
-
withNewAffinity
public StatelessEJBLocator<T> withNewAffinity(Affinity affinity)
Description copied from class:EJBLocator
Create a copy of this locator, but with the new given affinity.- Specified by:
withNewAffinity
in classEJBLocator<T>
- Parameters:
affinity
- the new affinity- Returns:
- the new locator
-
withSession
public StatefulEJBLocator<T> withSession(SessionID sessionId)
Description copied from class:EJBLocator
Create a copy of this locator, but with the given stateful session ID. If this locator cannot be converted, an exception is thrown.- Overrides:
withSession
in classEJBLocator<T>
- Parameters:
sessionId
- the stateful session ID (must not benull
)- Returns:
- the new locator (not
null
)
-
withSessionAndAffinity
public StatefulEJBLocator<T> withSessionAndAffinity(SessionID sessionId, Affinity affinity)
Description copied from class:EJBLocator
Create 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:
withSessionAndAffinity
in 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> StatelessEJBLocator<? extends S> narrowTo(Class<S> type)
Description copied from class:EJBLocator
Narrow this locator to the target type.- Overrides:
narrowTo
in classEJBLocator<T>
- Type Parameters:
S
- the target type- Parameters:
type
- the target type class- Returns:
- this instance, narrowed to the given type
-
narrowAsStateless
public <S> StatelessEJBLocator<? extends S> narrowAsStateless(Class<S> type)
Description copied from class:EJBLocator
Narrow this locator to the target type as a stateless locator.- Overrides:
narrowAsStateless
in 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 stateless locator
-
asStateless
public StatelessEJBLocator<T> asStateless()
Description copied from class:EJBLocator
Return this locator as a stateless locator, if it is one.- Overrides:
asStateless
in classEJBLocator<T>
- Returns:
- this instance, cast as a stateless locator
-
isStateless
public boolean isStateless()
Description copied from class:EJBLocator
Determine if this is a stateless locator. If so, calls toEJBLocator.asStateless()
andEJBLocator.narrowAsStateless(Class)
will generally succeed.- Overrides:
isStateless
in classEJBLocator<T>
- Returns:
true
if this locator is stateless,false
otherwise
-
equals
public boolean equals(Object other)
Determine whether this object is equal to another.- Overrides:
equals
in classEJBLocator<T>
- Parameters:
other
- the other object- Returns:
true
if they are equal,false
otherwise
-
equals
public boolean equals(EJBLocator<?> other)
Determine whether this object is equal to another.- Overrides:
equals
in classEJBLocator<T>
- Parameters:
other
- the other object- Returns:
true
if they are equal,false
otherwise
-
equals
public boolean equals(StatelessEJBLocator<?> other)
Determine whether this object is equal to another.- Parameters:
other
- the other object- Returns:
true
if they are equal,false
otherwise
-
-