Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mobicents.slee.runtime
Class SbbLocalObjectImpl  view SbbLocalObjectImpl download SbbLocalObjectImpl.java

java.lang.Object
  extended byorg.mobicents.slee.runtime.SbbLocalObjectImpl
All Implemented Interfaces:
SbbLocalObjectConcrete

public class SbbLocalObjectImpl
extends java.lang.Object
implements SbbLocalObjectConcrete

This is a SLEE provided interface to the Sbb object. The SLEE uses this interface to allow sbbs to access local methods. The following is excerpted from Slee Spec

An SBB may define SBB specific local interface methods in an SBB specific local interface. The SBB specific local interface must be public and must extend, either directly or indirectly, the SbbLocalObject interface. All SBBs have an SBB local interface. If the SBB Developer does not provide an SBB local interface for an SBB, then the SBB local interface of the SBB is the generic SbbLocalObject interface. The names of the SBB specific local interface methods must not begin with “sbb” or “ejb”. The SLEE provides the implementation of the methods defined in the SBB local interface. More precisely, the SLEE provides a concrete class that implements each SBB local interface. An SBB local object is an instance of this class. The SLEE provided implementations of these methods delegate invocations on an SBB local object that represents an SBB entity to an SBB object that represents the SBB entity (if the SBB entity has not been removed). The SBB Developer provides the implementation of SBB Developer defined local interface methods declared in the SBB specific extension of the SbbLocalObject interface in the SBB abstract class. For each method defined by the SBB Developer, there must be a matching method in the SBB abstract class. The matching method must have:

All SBB local objects that represent an SBB entity that does not exist are invalid. An attempted invocation on an invalid SBB local object marks the current transaction for rollback and throws a javax.slee.TransactionRolledbackLocalException (a subclass of javax.slee. SLEEException). An SBB Developer defined local interface method is a mandatory transactional method (see Section 9.6.1). The SLEE throws a javax.slee.TransactionRequiredLocalException if an SBB Developer defined local interface method of an SBB local object is invoked without a valid transaction context.

This method may also throw a javax.slee.SLEEException if the method failed due to a SLEE level or system level failure. If the caller of this method receives this exception, the caller does not know, in general, whether the corresponding method implementation in the SBB abstract class was invoked. The caller also does not know if the transaction has been marked for rollback. However, the caller may determine the transaction status by using the getRollbackOnly method (see Section 6.10.3).

The SBB Developer defined SBB local interface methods must not throw java.rmi.Remote- Exception, any subclass of RemoteException, or any RuntimeException. For more information on exception handling for SBB local object invocations, see Section 6.9.

Parameters to local interface methods are passed by reference.

Note that the SbbLocalObject does not expose the methods of the javax.slee.Sbb interface, event handler methods, or the various callback methods. These methods are used by the SLEE to manage SBB object instances, deliver events, and handle callbacks.


Nested Class Summary
(package private)  class SbbLocalObjectImpl.CmpRef
          cmp ref -- reference to me by some other sbb
 
Field Summary
private  java.util.HashSet cmpRefs
          A table of cmp fields that reference me.
private  java.lang.ClassLoader contextClassLoader
           
private  boolean isRemoved
           
private static org.jboss.logging.Logger logger
           
private  boolean rollbackOnly
           
private  java.lang.String sbbEntityId
          This is the Sbb entity to which the local object maps
private  org.mobicents.slee.container.SleeContainer sleeContainer
          Container where this resides -- for now this is the same location where the sbb resides.
private static java.lang.String tcache
           
 
Constructor Summary
SbbLocalObjectImpl()
           
SbbLocalObjectImpl(SbbEntity sbbEntity)
          Constructor -- assume that the Sbb entity is co-located with the Sbb local object.
SbbLocalObjectImpl(org.mobicents.slee.container.SleeContainer container, SbbEntity sbbEntity)
           
SbbLocalObjectImpl(org.mobicents.slee.container.SleeContainer container, java.lang.String sbbeId)
           
 
Method Summary
 void addCmpRef(java.lang.String fqnRoot, java.lang.String key)
           
 boolean equals(java.lang.Object other)
          Determine whether this Object is semantically equal to another Object.
 java.lang.ClassLoader getContextClassLoader()
          We need this in case we want to invoke some methods on the sbb using the local object.
protected  SbbEntity getSbbEntity()
           
 java.lang.String getSbbEntityId()
           
 byte getSbbPriority()
           
 boolean isIdentical(SbbLocalObject obj)
           
 void remove()
           
 void setSbbPriority(byte priority)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contextClassLoader

private java.lang.ClassLoader contextClassLoader

sbbEntityId

private java.lang.String sbbEntityId
This is the Sbb entity to which the local object maps


cmpRefs

private java.util.HashSet cmpRefs
A table of cmp fields that reference me.


sleeContainer

private org.mobicents.slee.container.SleeContainer sleeContainer
Container where this resides -- for now this is the same location where the sbb resides.


logger

private static org.jboss.logging.Logger logger

tcache

private static java.lang.String tcache

rollbackOnly

private boolean rollbackOnly

isRemoved

private boolean isRemoved
Constructor Detail

SbbLocalObjectImpl

public SbbLocalObjectImpl()

SbbLocalObjectImpl

public SbbLocalObjectImpl(org.mobicents.slee.container.SleeContainer container,
                          java.lang.String sbbeId)

SbbLocalObjectImpl

public SbbLocalObjectImpl(org.mobicents.slee.container.SleeContainer container,
                          SbbEntity sbbEntity)

SbbLocalObjectImpl

public SbbLocalObjectImpl(SbbEntity sbbEntity)
Constructor -- assume that the Sbb entity is co-located with the Sbb local object.

Method Detail

getSbbEntity

protected SbbEntity getSbbEntity()

getContextClassLoader

public java.lang.ClassLoader getContextClassLoader()
We need this in case we want to invoke some methods on the sbb using the local object.

Specified by:
getContextClassLoader in interface SbbLocalObjectConcrete

getSbbPriority

public byte getSbbPriority()
                    throws TransactionRequiredLocalException,
                           NoSuchObjectLocalException,
                           SLEEException

isIdentical

public boolean isIdentical(SbbLocalObject obj)
                    throws TransactionRequiredLocalException,
                           SLEEException

remove

public void remove()
            throws TransactionRequiredLocalException,
                   NoSuchObjectLocalException,
                   SLEEException

setSbbPriority

public void setSbbPriority(byte priority)
                    throws TransactionRequiredLocalException,
                           NoSuchObjectLocalException,
                           SLEEException

equals

public boolean equals(java.lang.Object other)
Description copied from class: java.lang.Object
Determine whether this Object is semantically equal to another Object.

There are some fairly strict requirements on this method which subclasses must follow:

  • It must be transitive. If a.equals(b) and b.equals(c), then a.equals(c) must be true as well.
  • It must be symmetric. a.equals(b) and b.equals(a) must have the same value.
  • It must be reflexive. a.equals(a) must always be true.
  • It must be consistent. Whichever value a.equals(b) returns on the first invocation must be the value returned on all later invocations.
  • a.equals(null) must be false.
  • It must be consistent with hashCode(). That is, a.equals(b) must imply a.hashCode() == b.hashCode(). The reverse is not true; two objects that are not equal may have the same hashcode, but that has the potential to harm hashing performance.

This is typically overridden to throw a java.lang.ClassCastException if the argument is not comparable to the class performing the comparison, but that is not a requirement. It is legal for a.equals(b) to be true even though a.getClass() != b.getClass(). Also, it is typical to never cause a java.lang.NullPointerException.

In general, the Collections API (java.util) use the equals method rather than the == operator to compare objects. However, java.util.IdentityHashMap is an exception to this rule, for its own good reasons.

The default implementation returns this == o.


getSbbEntityId

public java.lang.String getSbbEntityId()
Specified by:
getSbbEntityId in interface SbbLocalObjectConcrete

addCmpRef

public void addCmpRef(java.lang.String fqnRoot,
                      java.lang.String key)