Methods Summary |
---|
public void | addInitMethod(EjbInitInfo initInfo)
initMethods.add(initInfo);
|
public void | addPostActivateDescriptor(LifecycleCallbackDescriptor postActivateDesc)
String className = postActivateDesc.getLifecycleCallbackClass();
boolean found = false;
for (LifecycleCallbackDescriptor next :
getPostActivateDescriptors()) {
if (next.getLifecycleCallbackClass().equals(className)) {
found = true;
break;
}
}
if (!found) {
getPostActivateDescriptors().add(postActivateDesc);
}
|
public void | addPrePassivateDescriptor(LifecycleCallbackDescriptor prePassivateDesc)
String className = prePassivateDesc.getLifecycleCallbackClass();
boolean found = false;
for (LifecycleCallbackDescriptor next :
getPrePassivateDescriptors()) {
if (next.getLifecycleCallbackClass().equals(className)) {
found = true;
break;
}
}
if (!found) {
getPrePassivateDescriptors().add(prePassivateDesc);
}
|
public void | addRemoveMethod(EjbRemovalInfo removalInfo)
removeMethods.put(removalInfo.getRemoveMethod(), removalInfo);
|
public java.util.Set | getAllRemovalInfo()
return new HashSet<EjbRemovalInfo>(removeMethods.values());
|
public java.util.Set | getInitMethods()
return new HashSet<EjbInitInfo>(initMethods);
|
public java.util.Vector | getPossibleTransactionAttributes()
Vector txAttributes = super.getPossibleTransactionAttributes();
// Session beans that implement SessionSynchronization interface
// have a limited set of possible transaction attributes.
if( isStateful() ) {
try {
EjbBundleDescriptor ejbBundle = getEjbBundleDescriptor();
ClassLoader classLoader = ejbBundle.getClassLoader();
Class ejbClass = classLoader.loadClass(getEjbClassName());
Class sessionSynchClass =
javax.ejb.SessionSynchronization.class;
if( sessionSynchClass.isAssignableFrom(ejbClass) ) {
txAttributes = new Vector();
txAttributes.add(new ContainerTransaction
(ContainerTransaction.REQUIRED, ""));
txAttributes.add(new ContainerTransaction
(ContainerTransaction.REQUIRES_NEW, ""));
txAttributes.add(new ContainerTransaction
(ContainerTransaction.MANDATORY, ""));
}
} catch(Exception e) {
// Don't treat this as a fatal error. Just return full
// set of possible transaction attributes.
}
}
return txAttributes;
|
public LifecycleCallbackDescriptor | getPostActivateDescriptorByClass(java.lang.String className)
for (LifecycleCallbackDescriptor next :
getPostActivateDescriptors()) {
if (next.getLifecycleCallbackClass().equals(className)) {
return next;
}
}
return null;
|
public java.util.Set | getPostActivateDescriptors()
if (postActivateDescs == null) {
postActivateDescs =
new HashSet<LifecycleCallbackDescriptor>();
}
return postActivateDescs;
|
public LifecycleCallbackDescriptor | getPrePassivateDescriptorByClass(java.lang.String className)
for (LifecycleCallbackDescriptor next :
getPrePassivateDescriptors()) {
if (next.getLifecycleCallbackClass().equals(className)) {
return next;
}
}
return null;
|
public java.util.Set | getPrePassivateDescriptors()
if (prePassivateDescs == null) {
prePassivateDescs =
new HashSet<LifecycleCallbackDescriptor>();
}
return prePassivateDescs;
|
public EjbRemovalInfo | getRemovalInfo(MethodDescriptor method)
// first try to find the exact match
for (MethodDescriptor methodDesc : removeMethods.keySet()) {
if (methodDesc.equals(method)) {
return removeMethods.get(methodDesc);
}
}
// if nothing is found, try to find the loose match
for (MethodDescriptor methodDesc : removeMethods.keySet()) {
if (methodDesc.implies(method)) {
return removeMethods.get(methodDesc);
}
}
return null;
|
public java.lang.String | getSessionType()Returns the string STATELESS or STATEFUL according as to whether
the bean is stateless or stateful.
if (this.isStateless()) {
return STATELESS;
} else {
return STATEFUL;
}
|
public int | getTimeout()Returns the timeout value of this bean.
return this.timeout;
|
public java.lang.String | getType()Returns the type of this bean - always "Session".
return TYPE;
|
public boolean | hasInitMethods()
return (!initMethods.isEmpty());
|
public boolean | hasPostActivateMethod()
return (getPostActivateDescriptors().size() > 0);
|
public boolean | hasPrePassivateMethod()
return (getPrePassivateDescriptors().size() > 0);
|
public boolean | hasRemoveMethods()
return (!removeMethods.isEmpty());
|
public boolean | isStateful()
return !isStateless();
|
public boolean | isStateless()Returns true if I am describing a stateless session bean.
return isStateless;
|
public void | print(java.lang.StringBuffer toStringBuffer)Returns a formatted String of the attributes of this object.
toStringBuffer.append("Session descriptor");
toStringBuffer.append("\n isStateless ").append(isStateless);
super.print(toStringBuffer);
|
public void | setSessionType(java.lang.String sessionType)Accepts the Strings STATELESS or STATEFUL.
if (STATELESS.equals(sessionType)) {
this.setStateless(true);
return;
}
if (STATEFUL.equals(sessionType)) {
this.setStateless(false);
return;
}
if (this.isBoundsChecking()) {
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptionsessiontypenotlegaltype",
"{0} is not a legal session type for session ejbs. The type must be {1} or {2}", new Object[] {sessionType, STATEFUL, STATELESS}));
}
|
public void | setStateless(boolean isStateless)Sets the isStateless attribute of this session bean.
this.isStateless = isStateless;
super.changed();
|
public void | setTimeout(int timeout)Sets the timeout value for this session bean.
this.timeout = timeout;
|
public void | setTransactionType(java.lang.String transactionType)Sets the transaction type for this bean. Must be either BEAN_TRANSACTION_TYPE or CONTAINER_TRANSACTION_TYPE.
boolean isValidType = (BEAN_TRANSACTION_TYPE.equals(transactionType) ||
CONTAINER_TRANSACTION_TYPE.equals(transactionType));
if (!isValidType && this.isBoundsChecking()) {
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment..exceptointxtypenotlegaltype",
"{0} is not a legal transaction type for session beans", new Object[] {transactionType}));
} else {
super.transactionType = transactionType;
super.setMethodContainerTransactions(new Hashtable());
super.changed();
}
|
public void | setType(java.lang.String type)Sets my type
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptioncannotsettypeofsessionbean",
"Cannot set the type of a session bean"));
|