T
- the interface typepublic abstract class EJBLocator<T> extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
StatefulEJBLocator<T> |
asStateful()
Return this locator as a stateful locator, if it is one.
|
StatelessEJBLocator<T> |
asStateless()
Return this locator as a stateless locator, if it is one.
|
boolean |
canNarrowTo(Class<?> type)
Determine whether a
narrowTo(Class) operation would succeed. |
T |
createProxyInstance(InvocationHandler invocationHandler)
Create a proxy instance using the cached proxy class.
|
boolean |
equals(EJBLocator<?> other)
Determine whether this object is equal to another.
|
boolean |
equals(Object other)
Determine whether this object is equal to another.
|
Affinity |
getAffinity()
Get the locator affinity.
|
String |
getAppName()
Get the application name.
|
String |
getBeanName()
Get the EJB bean name.
|
String |
getDistinctName()
Get the module distinct name.
|
EJBIdentifier |
getIdentifier()
Get the EJB identifier for this locator.
|
String |
getModuleName()
Get the module name.
|
Class<? extends T> |
getProxyClass()
Get the proxy class for this locator.
|
Constructor<? extends T> |
getProxyConstructor()
Get the proxy class constructor for this locator.
|
Class<T> |
getViewType()
Get the view type of this locator.
|
int |
hashCode()
Get the hash code for this instance.
|
boolean |
isEntity()
Determine if this is an entity locator.
|
boolean |
isHome()
Determine if this is a home locator.
|
boolean |
isStateful()
Determine if this is a stateful locator.
|
boolean |
isStateless()
Determine if this is a stateless locator.
|
<S extends EJBObject> |
narrowAsEntity(Class<S> type)
Narrow this locator to the target type as a entity locator.
|
<S extends EJBHome> |
narrowAsHome(Class<S> type)
Narrow this locator to the target type as a home locator.
|
<S> StatefulEJBLocator<? extends S> |
narrowAsStateful(Class<S> type)
Narrow this locator to the target type as a stateful locator.
|
<S> StatelessEJBLocator<? extends S> |
narrowAsStateless(Class<S> type)
Narrow this locator to the target type as a stateless locator.
|
<S> EJBLocator<? extends S> |
narrowTo(Class<S> type)
Narrow this locator to the target type.
|
String |
toString() |
abstract EJBLocator<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.
|
public abstract EJBLocator<T> withNewAffinity(Affinity affinity)
affinity
- the new affinitypublic StatefulEJBLocator<T> withSession(SessionID sessionId)
sessionId
- the stateful session ID (must not be null
)null
)public StatefulEJBLocator<T> withSessionAndAffinity(SessionID sessionId, Affinity affinity)
sessionId
- the stateful session ID (must not be null
)affinity
- the new affinity (must not be null
)null
)public boolean canNarrowTo(Class<?> type)
narrowTo(Class)
operation would succeed.type
- the type to narrow totrue
if the narrow would succeed; false
otherwisepublic <S> EJBLocator<? extends S> narrowTo(Class<S> type)
S
- the target typetype
- the target type classClassCastException
- if the view type cannot be cast to the given typepublic <S extends EJBHome> EJBHomeLocator<? extends S> narrowAsHome(Class<S> type)
S
- the target typetype
- the target type classClassCastException
- if the view type cannot be cast to the given type or if this locator is not a home locatorpublic <S extends EJBObject> EntityEJBLocator<? extends S> narrowAsEntity(Class<S> type)
S
- the target typetype
- the target type classClassCastException
- if the view type cannot be cast to the given type or if this locator is not a entity locatorpublic <S> StatefulEJBLocator<? extends S> narrowAsStateful(Class<S> type)
S
- the target typetype
- the target type classClassCastException
- if the view type cannot be cast to the given type or if this locator is not a stateful locatorpublic <S> StatelessEJBLocator<? extends S> narrowAsStateless(Class<S> type)
S
- the target typetype
- the target type classClassCastException
- if the view type cannot be cast to the given type or if this locator is not a stateless locatorpublic StatelessEJBLocator<T> asStateless()
ClassCastException
- if this locator is not a stateless locatorpublic StatefulEJBLocator<T> asStateful()
ClassCastException
- if this locator is not a stateful locatorpublic boolean isStateless()
asStateless()
and narrowAsStateless(Class)
will generally succeed.true
if this locator is stateless, false
otherwisepublic boolean isStateful()
asStateful()
and narrowAsStateful(Class)
will generally succeed.true
if this locator is stateful, false
otherwisepublic boolean isEntity()
narrowAsEntity(Class)
will generally succeed.true
if this locator is an entity, false
otherwisepublic boolean isHome()
narrowAsHome(Class)
will generally succeed.true
if this locator is a home, false
otherwisepublic String getAppName()
public String getModuleName()
public String getBeanName()
public String getDistinctName()
public Affinity getAffinity()
public EJBIdentifier getIdentifier()
public final int hashCode()
public boolean equals(Object other)
public Class<? extends T> getProxyClass()
public Constructor<? extends T> getProxyConstructor()
InvocationHandler
.public T createProxyInstance(InvocationHandler invocationHandler)
invocationHandler
- the invocation handler to usepublic boolean equals(EJBLocator<?> other)
other
- the other objecttrue
if they are equal, false
otherwiseCopyright © 2017 JBoss by Red Hat. All rights reserved.