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:
  • Constructor Details

    • StatefulEJBLocator

      public StatefulEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, SessionID sessionId)
      Construct a new instance.
      Parameters:
      viewType - the view type
      appName - the application name
      moduleName - the module name
      beanName - the bean name
      sessionId - 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 type
      appName - the application name
      moduleName - the module name
      beanName - the bean name
      sessionId - the stateful session ID
      affinity - The Affinity for 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 type
      appName - the application name
      moduleName - the module name
      beanName - the bean name
      distinctName - the distinct name
      sessionId - 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 type
      appName - the application name
      moduleName - the module name
      beanName - the bean name
      distinctName - the distinct name
      sessionId - the stateful session ID
      affinity - The Affinity for this stateful bean locator
    • StatefulEJBLocator

      public StatefulEJBLocator(Class<T> viewType, EJBIdentifier identifier, SessionID sessionId, Affinity affinity)
      Construct a new instance.
      Parameters:
      viewType - the view type
      identifier - the Enterprise Beans identifier
      sessionId - the stateful session ID
      affinity - the Affinity for this stateful bean locator
    • StatefulEJBLocator

      public StatefulEJBLocator(Class<T> viewType, EJBIdentifier identifier, SessionID sessionId)
      Construct a new instance.
      Parameters:
      viewType - the view type
      identifier - the Enterprise Beans identifier
      sessionId - 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 locator
      newAffinity - 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 locator
      sessionId - 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 locator
      sessionId - the session ID
      newAffinity - 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 be null)
      identifier - the Enterprise Beans identifier (must not be null)
      sessionId - the stateful session ID (must not be null)
      affinity - the Affinity for 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: 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 class EJBLocator<T>
      Parameters:
      sessionId - the stateful session ID (must not be null)
      Returns:
      the new locator (not null)
    • withNewAffinity

      public StatefulEJBLocator<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 class EJBLocator<T>
      Parameters:
      affinity - the new affinity
      Returns:
      the new locator
    • 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 class EJBLocator<T>
      Parameters:
      sessionId - the stateful session ID (must not be null)
      affinity - the new affinity (must not be null)
      Returns:
      the new locator (not null)
    • narrowTo

      public <S> StatefulEJBLocator<? extends S> narrowTo(Class<S> type)
      Description copied from class: EJBLocator
      Narrow this locator to the target type.
      Overrides:
      narrowTo in class EJBLocator<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: EJBLocator
      Narrow this locator to the target type as a stateful locator.
      Overrides:
      narrowAsStateful in class EJBLocator<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: EJBLocator
      Return this locator as a stateful locator, if it is one.
      Overrides:
      asStateful in class EJBLocator<T>
      Returns:
      this instance, cast as a stateful locator
    • isStateful

      public boolean isStateful()
      Description copied from class: EJBLocator
      Determine if this is a stateful locator. If so, calls to EJBLocator.asStateful() and EJBLocator.narrowAsStateful(Class) will generally succeed.
      Overrides:
      isStateful in class EJBLocator<T>
      Returns:
      true if this locator is stateful, false otherwise
    • 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:
      equals in class EJBLocator<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 class EJBLocator<T>
      Parameters:
      other - the other object
      Returns:
      true if they are equal, false otherwise
    • equals

      public boolean equals(StatefulEJBLocator<?> other)
      Determine whether this object is equal to another.
      Parameters:
      other - the other object
      Returns:
      true if they are equal, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class EJBLocator<T>