Methods Summary |
---|
protected void | addAllInterfaceMethodsIn(java.util.Collection methodDescriptors, java.lang.Class c, java.lang.String methodIntf)
Method[] methods = c.getMethods();
for (int i=0;i<methods.length;i++) {
methodDescriptors.add(new MethodDescriptor(methods[i], methodIntf));
}
|
public void | addAroundInvokeDescriptor(LifecycleCallbackDescriptor aroundInvokeDesc)
String className = aroundInvokeDesc.getLifecycleCallbackClass();
boolean found = false;
for (LifecycleCallbackDescriptor next :
getAroundInvokeDescriptors()) {
if (next.getLifecycleCallbackClass().equals(className)) {
found = true;
break;
}
}
if (!found) {
getAroundInvokeDescriptors().add(aroundInvokeDesc);
}
|
public void | addEjbDescriptor(com.sun.enterprise.deployment.EjbDescriptor other)
this.transactionType = other.transactionType;
this.methodContainerTransactions = new Hashtable(other.getMethodContainerTransactions());
this.permissionedMethodsByPermission = new Hashtable(other.getPermissionedMethodsByPermission());
this.getEnvironmentProperties().addAll(other.getEnvironmentProperties());
this.getEjbReferenceDescriptors().addAll(other.getEjbReferenceDescriptors());
this.getJmsDestinationReferenceDescriptors().addAll(other.getJmsDestinationReferenceDescriptors());
this.getMessageDestinationReferenceDescriptors().addAll(other.getMessageDestinationReferenceDescriptors());
this.getResourceReferenceDescriptors().addAll(other.getResourceReferenceDescriptors());
this.getServiceReferenceDescriptors().addAll(other.getServiceReferenceDescriptors());
this.getRoleReferences().addAll(other.getRoleReferences());
this.getIORConfigurationDescriptors().addAll(other.getIORConfigurationDescriptors());
this.transactionType = other.transactionType;
this.ejbClassName = other.ejbClassName;
this.usesCallerIdentity = other.usesCallerIdentity;
this.bundleDescriptor = other.bundleDescriptor;
|
public void | addEjbReferenceDescriptor(com.sun.enterprise.deployment.types.EjbReference ejbReference)Adds a reference to another ejb to me.
ejbReferences.add(ejbReference);
ejbReference.setReferringBundleDescriptor(getEjbBundleDescriptor());
|
void | addEjbReferencer(EjbReferenceDescriptor ref)
ejbReferencersPointingToMe.add(ref);
|
public void | addEntityManagerFactoryReferenceDescriptor(EntityManagerFactoryReferenceDescriptor reference)
if( getEjbBundleDescriptor() != null ) {
reference.setReferringBundleDescriptor
(getEjbBundleDescriptor());
}
entityManagerFactoryReferences.add(reference);
|
public void | addEntityManagerReferenceDescriptor(EntityManagerReferenceDescriptor reference)
if( getEjbBundleDescriptor() != null ) {
reference.setReferringBundleDescriptor
(getEjbBundleDescriptor());
}
this.getEntityManagerReferenceDescriptors().add(reference);
|
public void | addEnvironmentProperty(EnvironmentProperty environmentProperty)Add the supplied environment property to the ejb descriptor's list.
if (environmentProperties.contains(environmentProperty)) {
replaceEnvironmentProperty(environmentProperty, environmentProperty);
} else {
environmentProperties.add(environmentProperty);
}
|
public void | addIORConfigurationDescriptor(EjbIORConfigurationDescriptor val)
iorConfigDescriptors.add(val);
this.changed();
|
public void | addJmsDestinationReferenceDescriptor(JmsDestinationReferenceDescriptor jmsDestReference)
jmsDestReferences.add(jmsDestReference);
|
public void | addMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor messageDestRef)
if( getEjbBundleDescriptor() != null ) {
messageDestRef.setReferringBundleDescriptor
(getEjbBundleDescriptor());
}
messageDestReferences.add(messageDestRef);
|
private void | addMethodPermissionForMethod(MethodPermission mp, MethodDescriptor md)
if (getPermissionedMethodsByPermission().containsKey(mp)) {
Set alreadyPermissionedMethodsForThisRole = (Set) getPermissionedMethodsByPermission().get(mp);
alreadyPermissionedMethodsForThisRole.add(md);
this.getPermissionedMethodsByPermission().put(mp, alreadyPermissionedMethodsForThisRole);
} else {
Set permissionedMethodsForThisRole = new HashSet();
permissionedMethodsForThisRole.add(md);
this.getPermissionedMethodsByPermission().put(mp, permissionedMethodsForThisRole);
}
this.changed();
|
private void | addMethodPermissionForStyledMethodDescriptor(MethodPermission mp, MethodDescriptor md)add a style 1 or 2 in our tables
if (styledMethodDescriptors==null) {
styledMethodDescriptors = new HashMap();
}
// we organize per method descriptors, makes it easier...
Set permissions = (Set) styledMethodDescriptors.get(md);
if (permissions==null)
permissions = new HashSet();
permissions.add(mp);
styledMethodDescriptors.put(md, permissions);
|
public void | addPermissionedMethod(MethodPermission mp, MethodDescriptor md)Add a new method permission to a method or a set of methods
if (getEjbBundleDescriptor() == null) {
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptioncannotaddrolesdescriptor",
"Cannot add roles when the descriptor is not part of a bundle"));
}
if (mp.isRoleBased()) {
if (!getEjbBundleDescriptor().getRoles().contains(mp.getRole())) {
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptioncannotaddrolesbundle",
"Cannot add roles when the bundle does not have them"));
}
}
if (md.isExact()) {
updateMethodPermissionForMethod(mp, md);
} else {
addMethodPermissionForStyledMethodDescriptor(mp, md);
}
saveMethodPermissionFromDD(mp,md);
|
public void | addPostConstructDescriptor(LifecycleCallbackDescriptor postConstructDesc)
String className = postConstructDesc.getLifecycleCallbackClass();
boolean found = false;
for (LifecycleCallbackDescriptor next :
getPostConstructDescriptors()) {
if (next.getLifecycleCallbackClass().equals(className)) {
found = true;
break;
}
}
if (!found) {
getPostConstructDescriptors().add(postConstructDesc);
}
|
public void | addPreDestroyDescriptor(LifecycleCallbackDescriptor preDestroyDesc)
String className = preDestroyDesc.getLifecycleCallbackClass();
boolean found = false;
for (LifecycleCallbackDescriptor next :
getPreDestroyDescriptors()) {
if (next.getLifecycleCallbackClass().equals(className)) {
found = true;
break;
}
}
if (!found) {
getPreDestroyDescriptors().add(preDestroyDesc);
}
|
public void | addResourceReferenceDescriptor(ResourceReferenceDescriptor resourceReference)Adds a resource reference to me.
resourceReferences.add(resourceReference);
|
public void | addRoleReference(RoleReference roleReference)Adds a role reference.
//_logger.log(Level.FINE,"add " + roleReference);
this.getRoleReferences().add(roleReference);
this.changed();
|
public void | addServiceReferenceDescriptor(ServiceReferenceDescriptor serviceRef)
serviceRef.setBundleDescriptor(getEjbBundleDescriptor());
serviceReferences.add(serviceRef);
|
public void | applyDefaultClassToLifecycleMethods()Since ejb-class is optional, in some cases the lifecycle-class
for AroundInvoke, PostConstruct, etc. methods on the bean-class
is not known at processing time and must be applied lazily. As such,
this method should only be called if the ejb-class has been set
on this EjbDescriptor.
Set<LifecycleCallbackDescriptor> lifecycleMethods =
new HashSet<LifecycleCallbackDescriptor>();
lifecycleMethods.addAll(getAroundInvokeDescriptors());
lifecycleMethods.addAll(getPostConstructDescriptors());
lifecycleMethods.addAll(getPreDestroyDescriptors());
if( getType().equals(EjbSessionDescriptor.TYPE) ) {
EjbSessionDescriptor sfulDesc = (EjbSessionDescriptor) this;
lifecycleMethods.addAll(sfulDesc.getPrePassivateDescriptors());
lifecycleMethods.addAll(sfulDesc.getPostActivateDescriptors());
}
for(LifecycleCallbackDescriptor next : lifecycleMethods) {
if( next.getLifecycleCallbackClass() == null ) {
next.setLifecycleCallbackClass(getEjbClassName());
}
}
|
public void | applyInterceptors(com.sun.enterprise.deployment.util.InterceptorBindingTranslator bindingTranslator)Derive all interceptors that are applicable to this bean.
// Apply this ejb to the ordered set of all interceptor bindings
// for this ejb-jar. The results will contain all interceptor
// information that applies to the ejb. There is no notion of
// default interceptors within the results. Default interceptors
// are used during the translation process but once we derive
// the per-ejb interceptor information there is only a notion of
// class-level ordering and method-level ordering. Any applicable
// default interceptors will have been applied to the class-level.
TranslationResults results = bindingTranslator.apply(getName());
allInterceptorClasses.clear();
allInterceptorClasses.addAll(results.allInterceptorClasses);
interceptorChain.clear();
interceptorChain.addAll(results.classInterceptorChain);
methodInterceptorsMap.clear();
methodInterceptorsMap.putAll(results.methodInterceptorsMap);
for (EjbInterceptor interceptor : allInterceptorClasses) {
for (Object ejbRefObj : interceptor.getEjbReferenceDescriptors()) {
addEjbReferenceDescriptor((EjbReference)ejbRefObj);
}
for (Object msgDestRefObj :
interceptor.getMessageDestinationReferenceDescriptors()) {
addMessageDestinationReferenceDescriptor(
(MessageDestinationReferenceDescriptor)msgDestRefObj);
}
for (Object envPropObj : interceptor.getEnvironmentProperties()) {
addEnvironmentProperty((EnvironmentProperty)envPropObj);
}
for (Object servRefObj :
interceptor.getServiceReferenceDescriptors()) {
addServiceReferenceDescriptor(
(ServiceReferenceDescriptor)servRefObj);
}
for (Object resRefObj :
interceptor.getResourceReferenceDescriptors()) {
addResourceReferenceDescriptor(
(ResourceReferenceDescriptor)resRefObj);
}
for (Object jmsDestRefObj:
interceptor.getJmsDestinationReferenceDescriptors()) {
addJmsDestinationReferenceDescriptor(
(JmsDestinationReferenceDescriptor)jmsDestRefObj);
}
for (EntityManagerFactoryReferenceDescriptor entMgrFacRef :
interceptor.getEntityManagerFactoryReferenceDescriptors()) {
addEntityManagerFactoryReferenceDescriptor(entMgrFacRef);
}
for (EntityManagerReferenceDescriptor entMgrRef :
interceptor.getEntityManagerReferenceDescriptors()) {
addEntityManagerReferenceDescriptor(entMgrRef);
}
}
|
public void | changed()Call to notify my listeners of a state change.
if (this.getEjbBundleDescriptor() != null) {
this.getEjbBundleDescriptor().changed();
} else {
super.changed();
}
|
private void | convertMethodContainerTransactions()
// container transactions first
//Hashtable transactions = this.getMethodContainerTransactions();
//_logger.log(Level.FINE,"Pre conversion = " + transactions);
Hashtable convertedTransactions = new Hashtable();
convertMethodContainerTransactionsOfStyle(1, convertedTransactions);
convertMethodContainerTransactionsOfStyle(2, convertedTransactions);
convertMethodContainerTransactionsOfStyle(3, convertedTransactions);
//_logger.log(Level.FINE,"Post conversion = " + convertedTransactions);
this.methodContainerTransactions = convertedTransactions;
|
private void | convertMethodContainerTransactionsOfStyle(int requestedStyleForConversion, java.util.Hashtable convertedMethods)
Collection transactionMethods = this.getTransactionMethodDescriptors();
Hashtable transactions = this.getMethodContainerTransactions();
for (Enumeration e=transactions.keys();e.hasMoreElements();) {
MethodDescriptor md = (MethodDescriptor) e.nextElement();
if (md.getStyle()==requestedStyleForConversion) {
ContainerTransaction ct = (ContainerTransaction) getMethodContainerTransactions().get(md);
for (Enumeration mds = md.doStyleConversion(this, transactionMethods).elements(); mds.hasMoreElements();) {
MethodDescriptor next = (MethodDescriptor) mds.nextElement();
convertedMethods.put(next, new ContainerTransaction(ct));
}
}
}
|
private void | convertMethodPermissions()convert all style 1 and style 2 method descriptors contained in
our tables into style 3 method descriptors.
if (styledMethodDescriptors==null)
return;
Set allMethods = getMethodDescriptors();
Set unpermissionedMethods = getMethodDescriptors();
Set methodDescriptors = styledMethodDescriptors.keySet();
for (Iterator styledMdItr = methodDescriptors.iterator();styledMdItr.hasNext();) {
MethodDescriptor styledMd = (MethodDescriptor) styledMdItr.next();
// Get the new permissions we are trying to set for this
// method(s)
Set newPermissions = (Set) styledMethodDescriptors.get(styledMd);
// Convert to style 3 method descriptors
Vector mds = styledMd.doStyleConversion(this, allMethods);
for (Iterator mdItr = mds.iterator(); mdItr.hasNext();) {
MethodDescriptor md = (MethodDescriptor) mdItr.next();
// remove it from the list of unpermissioned methods.
// it will be used at the end to set all remaining methods
// with the unchecked method permission
unpermissionedMethods.remove(md);
// iterator over the new set of method permissions for that
// method descriptor and update the table
for (Iterator newPermissionsItr = newPermissions.iterator();newPermissionsItr.hasNext();) {
MethodPermission newMp = (MethodPermission) newPermissionsItr.next();
updateMethodPermissionForMethod(newMp, md);
}
}
}
// All remaining methods should now be defined as unchecked...
MethodPermission mp = MethodPermission.getUncheckedMethodPermission();
Iterator iterator = unpermissionedMethods.iterator();
while(iterator.hasNext()) {
MethodDescriptor md = (MethodDescriptor) iterator.next();
if (getMethodPermissions(md).isEmpty()) {
addMethodPermissionForMethod(mp, md);
}
}
// finally we reset the list of method descriptors that need style conversion
styledMethodDescriptors = null;
|
void | doMethodDescriptorConversions()
// container transactions first
Hashtable transactions = this.getMethodContainerTransactions();
//_logger.log(Level.FINE,"Pre conversion = " + transactions);
Hashtable convertedTransactions = new Hashtable();
Collection transactionMethods = this.getTransactionMethodDescriptors();
for (Enumeration e = transactions.keys(); e.hasMoreElements();) {
MethodDescriptor md = (MethodDescriptor) e.nextElement();
ContainerTransaction ct = (ContainerTransaction) transactions.get(md);
for (Enumeration mds = md.doStyleConversion(this, transactionMethods).elements(); mds.hasMoreElements();) {
MethodDescriptor next = (MethodDescriptor) mds.nextElement();
convertedTransactions.put(next, new ContainerTransaction(ct));
}
}
//_logger.log(Level.FINE,"Post conversion = " + convertedTransactions);
setMethodContainerTransactions(convertedTransactions);
convertMethodPermissions();
|
private void | dumpMethodPermissions()
_logger.log(Level.FINE,"For Bean " + getName());
Map allPermissions = getPermissionedMethodsByPermission();
Set permissions = allPermissions.keySet();
for (Iterator permissionsIterator = permissions.iterator();permissionsIterator.hasNext();) {
MethodPermission mp = (MethodPermission) permissionsIterator.next();
_logger.log(Level.FINE," Method Permission : " + mp);
Set allMethods = (Set) getPermissionedMethodsByPermission().get(mp);
for (Iterator methodIterator = allMethods.iterator();methodIterator.hasNext();) {
MethodDescriptor md = (MethodDescriptor) methodIterator.next();
_logger.log(Level.FINE," -> " + md);
}
}
|
public java.util.Set | getAllEjbReferencers()
return ejbReferencersPointingToMe;
|
java.util.Set | getAllMethodDescriptors()
Set allMethodDescriptors = new HashSet();
for (Enumeration e = getMethodContainerTransactions().keys(); e.hasMoreElements();) {
allMethodDescriptors.add(e.nextElement());
}
for (Iterator e = this.getPermissionedMethodsByPermission().keySet().iterator(); e.hasNext();) {
MethodPermission nextPermission = (MethodPermission) e.next();
Set permissionedMethods = (Set) this.getPermissionedMethodsByPermission().get(nextPermission);
for (Iterator itr = permissionedMethods.iterator(); itr.hasNext();) {
allMethodDescriptors.add(itr.next());
}
}
return allMethodDescriptors;
|
public Application | getApplication()Gets the application to which this ejb descriptor belongs.
if (getEjbBundleDescriptor() != null) {
return getEjbBundleDescriptor().getApplication();
}
return null;
|
public LifecycleCallbackDescriptor | getAroundInvokeDescriptorByClass(java.lang.String className)
for (LifecycleCallbackDescriptor next :
getAroundInvokeDescriptors()) {
if (next.getLifecycleCallbackClass().equals(className)) {
return next;
}
}
return null;
|
public java.util.Set | getAroundInvokeDescriptors()
return aroundInvokeDescs;
|
public java.util.List | getAroundInvokeInterceptors(MethodDescriptor businessMethod)Return the ordered list of interceptor info for AroundInvoke behavior
of a particular business method. This list *does* include the info
on any bean class interceptor. If present, this would always be the
last element in the list because of the precedence defined by the spec.
LinkedList<EjbInterceptor> aroundInvokeInterceptors =
new LinkedList<EjbInterceptor>();
List<EjbInterceptor> classOrMethodInterceptors = null;
for (MethodDescriptor methodDesc : methodInterceptorsMap.keySet()) {
if (methodDesc.implies(businessMethod)) {
classOrMethodInterceptors =
methodInterceptorsMap.get(methodDesc);
}
}
if( classOrMethodInterceptors == null ) {
classOrMethodInterceptors = interceptorChain;
}
for (EjbInterceptor next : classOrMethodInterceptors) {
if (next.getAroundInvokeDescriptors().size() > 0) {
aroundInvokeInterceptors.add(next);
}
}
if( hasAroundInvokeMethod() ) {
EjbInterceptor interceptorInfo = new EjbInterceptor();
interceptorInfo.setFromBeanClass(true);
interceptorInfo.addAroundInvokeDescriptors(getAroundInvokeDescriptors());
interceptorInfo.setInterceptorClassName(getEjbImplClassName());
aroundInvokeInterceptors.add(interceptorInfo);
}
return aroundInvokeInterceptors;
|
private java.util.Set | getBusinessMethodDescriptors()Returns the full set of business method descriptors I have
ClassLoader classLoader = getEjbBundleDescriptor().getClassLoader();
Set methods = new HashSet();
try {
if (isRemoteInterfacesSupported()) {
addAllInterfaceMethodsIn(methods, classLoader.loadClass(getRemoteClassName()), MethodDescriptor.EJB_REMOTE);
}
if (isRemoteBusinessInterfacesSupported()) {
for(String intf : getRemoteBusinessClassNames()) {
addAllInterfaceMethodsIn(methods, classLoader.loadClass(intf), MethodDescriptor.EJB_REMOTE);
}
}
if (isLocalInterfacesSupported()) {
addAllInterfaceMethodsIn(methods, classLoader.loadClass(getLocalClassName()), MethodDescriptor.EJB_LOCAL);
}
if (isLocalBusinessInterfacesSupported()) {
for(String intf : getLocalBusinessClassNames()) {
addAllInterfaceMethodsIn(methods, classLoader.loadClass(intf), MethodDescriptor.EJB_LOCAL);
}
}
if (hasWebServiceEndpointInterface()) {
addAllInterfaceMethodsIn(methods, classLoader.loadClass(getWebServiceEndpointInterfaceName()), MethodDescriptor.EJB_WEB_SERVICE);
}
} catch (Throwable t) {
_logger.log(Level.SEVERE,"enterprise.deployment.backend.methodClassLoadFailure",new Object [] {"(EjbDescriptor.getBusinessMethodDescriptors())"});
throw new RuntimeException(t);
}
return methods;
|
public java.util.List | getCallbackInterceptors(com.sun.enterprise.deployment.LifecycleCallbackDescriptor.CallbackType type)Return the ordered list of interceptor info for a particular
callback event type. This list *does* include the info
on any bean class callback. If present, this would always be the
last element in the list because of the precedence defined by the spec.
LinkedList<EjbInterceptor> callbackInterceptors =
new LinkedList<EjbInterceptor>();
for (EjbInterceptor next : interceptorChain) {
if (next.getCallbackDescriptors(type).size() > 0) {
callbackInterceptors.add(next);
}
}
EjbInterceptor beanClassCallbackInfo = null;
switch(type) {
case POST_CONSTRUCT :
if( hasPostConstructMethod() ) {
beanClassCallbackInfo = new EjbInterceptor();
beanClassCallbackInfo.setFromBeanClass(true);
beanClassCallbackInfo.addCallbackDescriptors
(type, getPostConstructDescriptors());
}
break;
case PRE_DESTROY :
if( hasPreDestroyMethod() ) {
beanClassCallbackInfo = new EjbInterceptor();
beanClassCallbackInfo.setFromBeanClass(true);
beanClassCallbackInfo.addCallbackDescriptors
(type, getPreDestroyDescriptors());
}
break;
case PRE_PASSIVATE :
if( ((EjbSessionDescriptor)this).hasPrePassivateMethod() ) {
beanClassCallbackInfo = new EjbInterceptor();
beanClassCallbackInfo.setFromBeanClass(true);
beanClassCallbackInfo.addCallbackDescriptors(type,
((EjbSessionDescriptor)this).getPrePassivateDescriptors());
}
break;
case POST_ACTIVATE :
if( ((EjbSessionDescriptor)this).hasPostActivateMethod() ) {
beanClassCallbackInfo = new EjbInterceptor();
beanClassCallbackInfo.setFromBeanClass(true);
beanClassCallbackInfo.addCallbackDescriptors(type,
((EjbSessionDescriptor)this).getPostActivateDescriptors());
}
break;
}
if( beanClassCallbackInfo != null ) {
beanClassCallbackInfo.setInterceptorClassName
(getEjbImplClassName());
callbackInterceptors.add(beanClassCallbackInfo);
}
return callbackInterceptors;
|
public ContainerTransaction | getContainerTransaction()returns a ContainerTransaction if all the transactional methods on
the ejb descriptor have the same transaction type else return null
Vector transactionalMethods = new Vector(this.getTransactionMethodDescriptors());
MethodDescriptor md = (MethodDescriptor) transactionalMethods.firstElement();
if (md != null) {
ContainerTransaction first = this.getContainerTransactionFor(md);
for (Enumeration e = transactionalMethods.elements(); e.hasMoreElements();) {
MethodDescriptor next = (MethodDescriptor) e.nextElement();
ContainerTransaction nextCt = this.getContainerTransactionFor(next);
if (nextCt != null && !nextCt.equals(first)) {
return null;
}
}
return first;
}
return null;
|
public ContainerTransaction | getContainerTransactionFor(MethodDescriptor methodDescriptor)Fetches the assigned container transaction object for the given method object or null.
ContainerTransaction containerTransaction = null;
if (this.needToConvertMethodContainerTransactions()) {
this.convertMethodContainerTransactions();
}
containerTransaction = (ContainerTransaction) this.getMethodContainerTransactions().get(methodDescriptor);
if (containerTransaction == null) {
if (this.isBoundsChecking() && usesDefaultTransaction) {
containerTransaction = new ContainerTransaction(ContainerTransaction.REQUIRED, "");
this.getMethodContainerTransactions().put(methodDescriptor, containerTransaction);
} else {
containerTransaction = null;
}
}
return containerTransaction;
|
public java.lang.String | getEJBLocalObjectImplClassName()Returns the classname of the EJBLocalObject impl.
return this.ejbLocalObjectImplClassName;
|
public java.lang.String | getEJBObjectImplClassName()Returns the classname of the EJBObject impl.
return this.ejbObjectImplClassName;
|
public EjbBundleDescriptor | getEjbBundleDescriptor()Gets the containing ejb bundle descriptor..
return bundleDescriptor;
|
public java.lang.String | getEjbClassName()Returns the classname of the ejb.
return this.ejbClassName;
|
public java.lang.String | getEjbImplClassName()IASRI 4725194
Returns the Execution class ,which is same as the user-specified class
in case of Message,Session and Bean Managed Persistence Entity Beans
but is different for Container Mananged Persistence Entity Bean
Therefore,the implementation in the base class is to return
getEjbClassName() and the method is redefined in IASEjbCMPDescriptor.
return this.getEjbClassName();
|
public com.sun.enterprise.deployment.types.EjbReference | getEjbReference(java.lang.String name)Return a reference to another ejb by the same name or throw an IllegalArgumentException.
for (Iterator itr = this.getEjbReferenceDescriptors().iterator(); itr.hasNext();) {
EjbReference er = (EjbReference) itr.next();
if (er.getName().equals(name)) {
return er;
}
}
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptionbeanhasnoejbrefbyname",
"This bean {0} has no ejb reference by the name of {1}",
new Object[] {getName(), name}));
|
public EjbReferenceDescriptor | getEjbReferenceByName(java.lang.String name)Return a reference to another ejb by the same name or throw an IllegalArgumentException.
return (EjbReferenceDescriptor) getEjbReference(name);
|
public java.util.Set | getEjbReferenceDescriptors()Return the set of ejb references this ejb declares.
return ejbReferences;
|
public MethodDescriptor | getEjbTimeoutMethod()
return timedObjectMethod;
|
public EntityManagerFactoryReferenceDescriptor | getEntityManagerFactoryReferenceByName(java.lang.String name)Return the entity manager factory reference descriptor corresponding to
the given name.
for (EntityManagerFactoryReferenceDescriptor next :
getEntityManagerFactoryReferenceDescriptors()) {
if (next.getName().equals(name)) {
return next;
}
}
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptionbeanhasnoentitymgrfactoryrefbyname",
"This ejb {0} has no entity manager factory reference by the name of {1}",
new Object[] {getName(), name}));
|
public java.util.Set | getEntityManagerFactoryReferenceDescriptors()
return entityManagerFactoryReferences;
|
public EntityManagerReferenceDescriptor | getEntityManagerReferenceByName(java.lang.String name)Return the entity manager factory reference descriptor corresponding to
the given name.
for (EntityManagerReferenceDescriptor next :
getEntityManagerReferenceDescriptors()) {
if (next.getName().equals(name)) {
return next;
}
}
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptionbeanhasnoentitymgrrefbyname",
"This ejb {0} has no entity manager reference by the name of {1}",
new Object[] {getName(), name}));
|
public java.util.Set | getEntityManagerReferenceDescriptors()
return entityManagerReferences;
|
public java.util.Set | getEnvironmentProperties()Return a copy of the structure holding the environ,ent properties.
return environmentProperties;
|
public EnvironmentProperty | getEnvironmentPropertyByName(java.lang.String name)Returns the environment property object searching on the supplied key.
throws an illegal argument exception if no such environment property exists.
for (Iterator itr = this.getEnvironmentProperties().iterator(); itr.hasNext();) {
EnvironmentProperty ev = (EnvironmentProperty) itr.next();
if (ev.getName().equals(name)) {
return ev;
}
}
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptionbeanhasnoenvpropertybyname",
"This bean {0} has no environment property by the name of {1}",
new Object[] {getName(), name}));
|
public java.util.Set | getExcludedMethodDescriptors()
if (needToConvertMethodPermissions()) {
convertMethodPermissions();
}
return (Set) getPermissionedMethodsByPermission().get(MethodPermission.getExcludedMethodPermission());
|
public java.util.Vector | getFieldDescriptors()
Vector fields = this.getFields();
Vector fieldDescriptors = new Vector();
for(int fieldIndex = 0; fieldIndex < fields.size(); fieldIndex++) {
Field field = (Field) fields.elementAt(fieldIndex);
fieldDescriptors.insertElementAt(new FieldDescriptor(field) , fieldIndex);
}
return fieldDescriptors;
|
public java.util.Vector | getFields()Return a Vector of the Field objetcs of this ejb.
Vector fieldsVector = new Vector();
Class ejb = null;
try {
ClassLoader cl = getEjbBundleDescriptor().getClassLoader();
ejb = cl.loadClass(this.getEjbClassName());
} catch (Throwable t) {
_logger.log(Level.SEVERE,"enterprise.deployment.backend.methodClassLoadFailure",new Object[] {this.getEjbClassName()});
return fieldsVector;
}
Field[] fields = ejb.getFields();
for (int i = 0; i < fields.length; i++) {
fieldsVector.addElement(fields[i]);
}
return fieldsVector;
|
public com.sun.enterprise.deployment.runtime.IASEjbExtraDescriptors | getIASEjbExtraDescriptors()returns the extra iAS specific info (not in the RI DID) in the iAS DTD.
no setter. You have to modify some fields of the returned object to change it.
TODO: check if we need to clone it in the Copy Constructor... // Ludo 12/10/2001 extra DTD info only for iAS
return iASEjbExtraDescriptors;
|
public java.util.Set | getIORConfigurationDescriptors()
return iorConfigDescriptors;
|
public java.util.List | getInjectableResourcesByClass(java.lang.String className)
return bundleDescriptor.getInjectableResourcesByClass
(className, this);
|
public InjectionInfo | getInjectionInfoByClass(java.lang.String className)
return bundleDescriptor.getInjectionInfoByClass(className, this);
|
public java.util.List | getInterceptorChain()
return new LinkedList<EjbInterceptor>( interceptorChain );
|
public java.util.Set | getInterceptorClassNames()Return an unordered set of the names of all interceptor classes
for this bean. This list does not include the name of the bean
class itself, even if the bean class declares AroundInvoke methods
and/or callbacks.
HashSet<String> classNames = new HashSet<String>();
for (EjbInterceptor ei : getInterceptorClasses()) {
classNames.add(ei.getInterceptorClassName());
}
return classNames;
|
public java.util.Set | getInterceptorClasses()Return an unordered set of interceptor descriptors for this bean.
This list does not include interceptor info for the bean
class itself, even if the bean class declares AroundInvoke methods
and/or callbacks.
return new HashSet<EjbInterceptor>(allInterceptorClasses);
|
public JmsDestinationReferenceDescriptor | getJmsDestinationReferenceByName(java.lang.String name)Return a reference to another ejb by the same name or throw an IllegalArgumentException.
for (Iterator itr = this.getJmsDestinationReferenceDescriptors().iterator(); itr.hasNext();) {
JmsDestinationReferenceDescriptor jdr = (JmsDestinationReferenceDescriptor) itr.next();
if (jdr.getName().equals(name)) {
return jdr;
}
}
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptionbeanhasnojmsdestrefbyname",
"This bean {0} has no resource environment reference by the name of {1}",
new Object[] {getName(), name}));
|
public java.util.Set | getJmsDestinationReferenceDescriptors()Return the set of JMS destination references this ejb declares.
return jmsDestReferences;
|
public java.lang.String | getLocalHomeImplClassName()Returns the classname of the Local home impl.
return this.localHomeImplClassName;
|
public MessageDestinationReferenceDescriptor | getMessageDestinationReferenceByName(java.lang.String name)Looks up an message destination reference with the given name.
Throws an IllegalArgumentException if it is not found.
for (MessageDestinationReferenceDescriptor mdr : messageDestReferences) {
if (mdr.getName().equals(name)) {
return mdr;
}
}
throw new IllegalArgumentException(localStrings.getLocalString(
"exceptionejbhasnomsgdestrefbyname",
"This ejb [{0}] has no message destination reference by the name of [{1}]",
new Object[] {getName(), name}));
|
public java.util.Set | getMessageDestinationReferenceDescriptors()
return messageDestReferences;
|
public java.util.Hashtable | getMethodContainerTransactions()Return a copy of the mapping held internally of method descriptors to container transaction objects.
if (this.methodContainerTransactions == null) {
this.methodContainerTransactions = new Hashtable();
}
return methodContainerTransactions;
|
public java.util.Set | getMethodDescriptors()Returns the full set of method descriptors I have (from all the methods on my home and remote interfaces).
ClassLoader classLoader = getEjbBundleDescriptor().getClassLoader();
Set methods = new HashSet();
try {
if (isRemoteInterfacesSupported()) {
addAllInterfaceMethodsIn(methods, classLoader.loadClass(getHomeClassName()), MethodDescriptor.EJB_HOME);
addAllInterfaceMethodsIn(methods, classLoader.loadClass(getRemoteClassName()), MethodDescriptor.EJB_REMOTE);
}
if (isRemoteBusinessInterfacesSupported()) {
for(String intf : getRemoteBusinessClassNames()) {
addAllInterfaceMethodsIn(methods, classLoader.loadClass(intf), MethodDescriptor.EJB_REMOTE);
}
}
if (isLocalInterfacesSupported()) {
addAllInterfaceMethodsIn(methods, classLoader.loadClass(getLocalHomeClassName()), MethodDescriptor.EJB_LOCALHOME);
addAllInterfaceMethodsIn(methods, classLoader.loadClass(getLocalClassName()), MethodDescriptor.EJB_LOCAL);
}
if (isLocalBusinessInterfacesSupported()) {
for(String intf : getLocalBusinessClassNames()) {
addAllInterfaceMethodsIn(methods, classLoader.loadClass(intf), MethodDescriptor.EJB_LOCAL);
}
}
if (hasWebServiceEndpointInterface()) {
addAllInterfaceMethodsIn(methods, classLoader.loadClass(getWebServiceEndpointInterfaceName()), MethodDescriptor.EJB_WEB_SERVICE);
}
} catch (Throwable t) {
/*
t.printStackTrace();
_logger.log(Level.SEVERE,localStrings.getLocalString(
"enterprise.deployment.errorloadingclass",
"Error loading class {0}", new Object [] {"(EjbDescriptor.getMethods())"}));
*/
_logger.log(Level.SEVERE,"enterprise.deployment.backend.methodClassLoadFailure",new Object [] {"(EjbDescriptor.getMethods())"});
throw new RuntimeException(t);
}
return methods;
|
public java.util.Map | getMethodInterceptorsMap()
return new HashMap<MethodDescriptor, List<EjbInterceptor>>
(methodInterceptorsMap);
|
private java.util.Set | getMethodPermissions(MethodDescriptor methodDescriptor)
Set methodPermissionsForMethod = new HashSet();
for (Iterator e = this.getPermissionedMethodsByPermission().keySet().iterator(); e.hasNext();) {
MethodPermission nextPermission = (MethodPermission) e.next();
Set permissionedMethods = (Set) this.getPermissionedMethodsByPermission().get(nextPermission);
for (Iterator itr = permissionedMethods.iterator(); itr.hasNext();) {
MethodDescriptor md = (MethodDescriptor) itr.next();
if (md.equals(methodDescriptor)) {
methodPermissionsForMethod.add(nextPermission);
}
}
}
return methodPermissionsForMethod;
|
public java.util.Set | getMethodPermissionsFor(MethodDescriptor methodDescriptor)
if (needToConvertMethodPermissions()) {
convertMethodPermissions();
}
return getMethodPermissions(methodDescriptor);
|
public java.util.HashMap | getMethodPermissionsFromDD()Get a record of all the Method Permissions exactly as they were in the`DD
return methodPermissionsFromDD;
|
public java.util.Vector | getMethods()Return the set of method objects on my home and remote interfaces.
return getMethods(getEjbBundleDescriptor().getClassLoader());
|
public java.util.Vector | getMethods(java.lang.ClassLoader classLoader)Return the ejb method objects, i.e. the methods on the home and remote interfaces.
try {
return BeanMethodCalculator.getMethodsFor(this, classLoader);
} catch (Throwable t) {
_logger.log(Level.SEVERE,"enterprise.deployment.backend.methodClassLoadFailure",new Object [] {"(EjbDescriptor.getMethods())"});
throw new RuntimeException(t);
}
|
public java.util.Map | getPermissionedMethodsByPermission()
if (permissionedMethodsByPermission==null) {
permissionedMethodsByPermission = new Hashtable();
}
return permissionedMethodsByPermission;
|
public java.util.Set | getPermissionedRoles()
if (needToConvertMethodPermissions()) {
convertMethodPermissions();
}
Set allPermissionedRoles = new HashSet();
for (Iterator i = this.getPermissionedMethodsByPermission().keySet().iterator(); i.hasNext();) {
MethodPermission pm = (MethodPermission) i.next();
if (pm.isRoleBased()) {
allPermissionedRoles.add(pm.getRole());
}
}
return allPermissionedRoles;
|
public java.util.Vector | getPossibleTransactionAttributes()Returns the set of transaction attributes that can be assigned
to methods of this ejb when in CMT mode. Elements are of type
ContainerTransaction
Vector txAttributes = new Vector();
txAttributes.add(new ContainerTransaction
(ContainerTransaction.MANDATORY, ""));
txAttributes.add(new ContainerTransaction
(ContainerTransaction.NEVER, ""));
txAttributes.add(new ContainerTransaction
(ContainerTransaction.NOT_SUPPORTED, ""));
txAttributes.add(new ContainerTransaction
(ContainerTransaction.REQUIRED, ""));
txAttributes.add(new ContainerTransaction
(ContainerTransaction.REQUIRES_NEW, ""));
txAttributes.add(new ContainerTransaction
(ContainerTransaction.SUPPORTS, ""));
return txAttributes;
|
public LifecycleCallbackDescriptor | getPostConstructDescriptorByClass(java.lang.String className)
return bundleDescriptor.getPostConstructDescriptorByClass
(className, this);
|
public java.util.Set | getPostConstructDescriptors()
return postConstructDescs;
|
public LifecycleCallbackDescriptor | getPreDestroyDescriptorByClass(java.lang.String className)
return bundleDescriptor.getPreDestroyDescriptorByClass
(className, this);
|
public java.util.Set | getPreDestroyDescriptors()
return preDestroyDescs;
|
public java.lang.String | getRemoteHomeImplClassName()Returns the classname of the remote home impl.
return this.remoteHomeImplClassName;
|
public ResourceReferenceDescriptor | getResourceReferenceByName(java.lang.String name)Return the resource object corresponding to the supplied name or throw an illegal argument exception.
for (Iterator itr = this.getResourceReferenceDescriptors().iterator(); itr.hasNext();) {
ResourceReferenceDescriptor next = (ResourceReferenceDescriptor) itr.next();
if (next.getName().equals(name)) {
return next;
}
}
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptionbeanhasnoresourcerefbyname",
"This bean {0} has no resource reference by the name of {1}",
new Object[] {getName(), name}));
|
public java.util.Set | getResourceReferenceDescriptors()Return the set of resource references this ejb declares.
return resourceReferences;
|
public java.util.Set | getResourceReferenceDescriptors(boolean resolved)Return the set of resource references this ejb declares that have been resolved..
Set<ResourceReferenceDescriptor> toReturn = new HashSet<ResourceReferenceDescriptor>();
for (Iterator itr = this.getResourceReferenceDescriptors().iterator(); itr.hasNext();) {
ResourceReferenceDescriptor next = (ResourceReferenceDescriptor) itr.next();
if (next.isResolved() == resolved) {
toReturn.add(next);
}
}
return toReturn;
|
public RoleReference | getRoleReferenceByName(java.lang.String roleReferenceName)Returns a matching role reference by name or throw an IllegalArgumentException.
for (Iterator itr = this.getRoleReferences().iterator(); itr.hasNext();) {
RoleReference nextRR = (RoleReference) itr.next();
if (nextRR.getName().equals( roleReferenceName )) {
return nextRR;
}
}
return null;
|
public java.util.Set | getRoleReferences()Return a copy of the role references set.
if (roleReferences == null) {
roleReferences = new HashSet();
}
return roleReferences;
|
public RunAsIdentityDescriptor | getRunAsIdentity()
if ( usesCallerIdentity == null || usesCallerIdentity )
throw new IllegalStateException(localStrings.getLocalString(
"exceptioncannotgetrunas",
"Cannot get RunAs identity when using caller identity"));
return runAsIdentity;
|
public java.util.Set | getSecurityBusinessMethodDescriptors()Returns the full set of security business method descriptors I have.
return getBusinessMethodDescriptors();
|
public java.lang.String | getSecurityIdentityDescription()Get the description field of security-identity
if ( securityIdentityDescription == null )
securityIdentityDescription = "";
return securityIdentityDescription;
|
public ServiceReferenceDescriptor | getServiceReferenceByName(java.lang.String name)Looks up an service reference with the given name.
Throws an IllegalArgumentException if it is not found.
for (Iterator itr = this.getServiceReferenceDescriptors().iterator();
itr.hasNext();) {
ServiceReferenceDescriptor srd = (ServiceReferenceDescriptor)
itr.next();
if (srd.getName().equals(name)) {
return srd;
}
}
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptionejbhasnoservicerefbyname",
"This ejb [{0}] has no service reference by the name of [{1}]",
new Object[] {getName(), name}));
|
public java.util.Set | getServiceReferenceDescriptors()
return serviceReferences;
|
public java.util.Map | getStyledPermissionedMethodsByPermission()
if (styledMethodDescriptors==null) {
return null;
}
// the current info is structured as MethodDescriptors as keys to
// method permission, let's reverse this to make the Map using the
// method permission as a key.
Map styledMethodDescriptorsByPermission = new HashMap();
for (Iterator mdIterator=styledMethodDescriptors.keySet().iterator();mdIterator.hasNext();) {
MethodDescriptor md = (MethodDescriptor) mdIterator.next();
Set methodPermissions = (Set) styledMethodDescriptors.get(md);
for (Iterator mpIterator = methodPermissions.iterator(); mpIterator.hasNext();) {
MethodPermission mp = (MethodPermission) mpIterator.next();
Set methodDescriptors = (Set) styledMethodDescriptorsByPermission.get(mp);
if (methodDescriptors == null) {
methodDescriptors = new HashSet();
}
methodDescriptors.add(md);
styledMethodDescriptorsByPermission.put(mp, methodDescriptors);
}
}
return styledMethodDescriptorsByPermission;
|
public java.util.Collection | getTransactionMethodDescriptors()
return getTransactionMethods(getEjbBundleDescriptor().getClassLoader());
|
protected java.util.Collection | getTransactionMethods(java.lang.ClassLoader classLoader)
try {
return BeanMethodCalculator.getTransactionalMethodsFor(this,classLoader);
} catch (Throwable t) {
_logger.log(Level.SEVERE,"enterprise.deployment.backend.methodClassLoadFailure",new Object [] {"(EjbDescriptor.getMethods())"});
throw new RuntimeException(t);
}
|
public java.lang.String | getTransactionType()The transaction type of this ejb.
return this.transactionType;
|
public java.util.Set | getTxBusinessMethodDescriptors()Returns the full set of transactional business method descriptors I have.
Set txBusMethods = getBusinessMethodDescriptors();
if (isTimedObject()) {
txBusMethods.add(getEjbTimeoutMethod());
}
return txBusMethods;
|
public java.util.Set | getUncheckedMethodDescriptors()
if (needToConvertMethodPermissions()) {
convertMethodPermissions();
}
return (Set) getPermissionedMethodsByPermission().get(MethodPermission.getUncheckedMethodPermission());
|
public long | getUniqueId()
return uniqueId;
|
public java.lang.Boolean | getUsesCallerIdentity()Get the usesCallerIdentity flag
return usesCallerIdentity;
|
public boolean | hasAroundInvokeMethod()
return (getAroundInvokeDescriptors().size() > 0);
|
public boolean | hasPostConstructMethod()
return (getPostConstructDescriptors().size() > 0);
|
public boolean | hasPreDestroyMethod()
return (getPreDestroyDescriptors().size() > 0);
|
public boolean | hasResolvedResourceReferences()Returns true if this ejb descriptor has resource references that are resolved.
if (!this.getResourceReferenceDescriptors().isEmpty()) {
return false;
} else {
for (Iterator itr = this.getResourceReferenceDescriptors().iterator(); itr.hasNext();) {
ResourceReferenceDescriptor resourceReference = (ResourceReferenceDescriptor) itr.next();
if (resourceReference.isResolved()) {
return true;
}
}
}
return false;
|
public boolean | isDistributedTransactionScope()Gets the transaction scope of this ejb.
return isDistributedTxScope;
|
public boolean | isTimedObject()
return (timedObjectMethod != null);
|
public boolean | isUsesDefaultTransaction()
return usesDefaultTransaction;
|
private boolean | needToConvertMethodContainerTransactions()
if (this.getEjbBundleDescriptor() != null) {
for (Enumeration e = this.getMethodContainerTransactions().keys(); e.hasMoreElements();) {
MethodDescriptor md = (MethodDescriptor) e.nextElement();
if (!md.isExact()) {
return true;
}
}
}
return false;
|
private boolean | needToConvertMethodPermissions()
return styledMethodDescriptors!=null;
|
public void | print(java.lang.StringBuffer toStringBuffer)Returns a formatted String of the attributes of this object.
super.print(toStringBuffer);
toStringBuffer.append("\n ejbClassName ").append(ejbClassName);
toStringBuffer.append("\n transactionType ").append(transactionType);
toStringBuffer.append("\n methodContainerTransactions ").append(getMethodContainerTransactions());
toStringBuffer.append("\n environmentProperties ");
if(environmentProperties != null)
printDescriptorSet(environmentProperties,toStringBuffer);
toStringBuffer.append("\n ejbReferences ");
if(ejbReferences != null)
printDescriptorSet(ejbReferences,toStringBuffer);
toStringBuffer.append("\n jmsDestReferences ");
if(jmsDestReferences != null)
printDescriptorSet(jmsDestReferences,toStringBuffer);
toStringBuffer.append("\n messageDestReferences ");
if(messageDestReferences != null)
printDescriptorSet(messageDestReferences,toStringBuffer);
toStringBuffer.append("\n resourceReferences ");
if(resourceReferences != null)
printDescriptorSet(resourceReferences,toStringBuffer);
toStringBuffer.append("\n serviceReferences ");
if(serviceReferences != null)
printDescriptorSet(serviceReferences,toStringBuffer);
toStringBuffer.append("\n roleReferences ");
if(roleReferences != null)
printDescriptorSet(roleReferences,toStringBuffer);
for (Iterator e = this.getPermissionedMethodsByPermission().keySet().iterator(); e.hasNext();) {
MethodPermission nextPermission = (MethodPermission) e.next();
toStringBuffer.append("\n method-permission->method: ");
nextPermission.print(toStringBuffer);
toStringBuffer.append(" -> ").append(this.getPermissionedMethodsByPermission().get(nextPermission));
}
|
private void | printDescriptorSet(java.util.Set descSet, java.lang.StringBuffer sbuf)
for(Iterator itr = descSet.iterator(); itr.hasNext();){
Object obj = itr.next();
if(obj instanceof Descriptor)
((Descriptor)obj).print(sbuf);
else
sbuf.append(obj);
}
|
private void | removeContainerTransactionFor(MethodDescriptor methodDescriptor)
getMethodContainerTransactions().remove(methodDescriptor);
|
public void | removeEjbReferenceDescriptor(com.sun.enterprise.deployment.types.EjbReference ejbReference)
ejbReferences.remove(ejbReference);
ejbReference.setReferringBundleDescriptor(null);
|
public void | removeEjbReferencer(EjbReferenceDescriptor ref)
ejbReferencersPointingToMe.remove(ref);
|
public void | removeEnvironmentProperty(EnvironmentProperty environmentProperty)Removes the given environment property from me.
this.getEnvironmentProperties().remove(environmentProperty);
this.changed();
|
public void | removeJmsDestinationReferenceDescriptor(JmsDestinationReferenceDescriptor jmsDestReference)
jmsDestReferences.remove(jmsDestReference);
|
public void | removeMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor msgDestRef)
messageDestReferences.remove(msgDestRef);
|
public void | removePermissionedMethod(MethodPermission mp, MethodDescriptor md)Remove a method permission from a method or a set of methods
if (this.getEjbBundleDescriptor() == null) {
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptioncanotaddrolesdescriptor",
"Cannot add roles when the descriptor is not part of a bundle"));
}
if (mp.isRoleBased()) {
if (!getEjbBundleDescriptor().getRoles().contains(mp.getRole())) {
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptioncannotaddrolesbndledoesnothave",
"Cannot add roles when the bundle does not have them"));
}
}
if (this.getPermissionedMethodsByPermission().containsKey(mp)) {
Set alreadyPermissionedMethodsForThisRole = (Set) this.getPermissionedMethodsByPermission().get(mp);
alreadyPermissionedMethodsForThisRole.remove(md);
this.getPermissionedMethodsByPermission().put(mp, alreadyPermissionedMethodsForThisRole);
}
this.changed();
|
public void | removeResourceReferenceDescriptor(ResourceReferenceDescriptor resourceReference)Removes the given resource reference from me.
resourceReferences.remove(resourceReference);
|
void | removeRole(Role role)
//this.getPermissionedRoles().remove(role);
this.getPermissionedMethodsByPermission().remove(new MethodPermission(role));
Set roleReferences = new HashSet(this.getRoleReferences());
for (Iterator itr = roleReferences.iterator(); itr.hasNext();) {
RoleReference roleReference = (RoleReference) itr.next();
if (roleReference.getRole().equals(role)) {
roleReference.setValue("");
}
}
|
public void | removeRoleReference(RoleReference roleReference)Removes a role reference.
this.getRoleReferences().remove(roleReference);
this.changed();
|
public void | removeServiceReferenceDescriptor(ServiceReferenceDescriptor serviceRef)
serviceReferences.remove(serviceRef);
|
public void | replaceEnvironmentProperty(EnvironmentProperty oldOne, EnvironmentProperty newOne)Replaces the an environment proiperty with another one.
environmentProperties.remove(oldOne);
environmentProperties.add(newOne);
|
private void | saveMethodPermissionFromDD(MethodPermission mp, MethodDescriptor md)Keep a record of all the Method Permissions exactly as they were in the DD
if (methodPermissionsFromDD==null) {
methodPermissionsFromDD = new HashMap();
}
// we organize by permission, makes it easier...
// Use Array List as apposed to HashMap or Table because MethodDescriptor
// Equality once did not take into account differences in
// method interface, and will process sequentially.
ArrayList descriptors = (ArrayList) methodPermissionsFromDD.get(mp);
if (descriptors == null)
descriptors = new ArrayList();
descriptors.add(md);
methodPermissionsFromDD.put(mp, descriptors);
|
public void | setContainerTransactionFor(MethodDescriptor methodDescriptor, ContainerTransaction containerTransaction)Sets the container transaction for the given method descriptor.
Throws an Illegal argument if this ejb has transaction type BEAN_TRANSACTION_TYPE.
ContainerTransaction oldValue = this.getContainerTransactionFor(methodDescriptor);
if (oldValue == null || (oldValue != null && !(oldValue.equals(containerTransaction)))) {
String transactionType = this.getTransactionType();
if (transactionType == null) {
setTransactionType(CONTAINER_TRANSACTION_TYPE);
transactionType = CONTAINER_TRANSACTION_TYPE;
} else if (BEAN_TRANSACTION_TYPE.equals(transactionType)) {
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptiontxattrbtnotspecifiedinbeanwithtxtype",
"Method level transaction attributes may not be specified on a bean with transaction type {0}", new Object[] {EjbSessionDescriptor.BEAN_TRANSACTION_TYPE}));
}
//_logger.log(Level.FINE,"put " + methodDescriptor + " " + containerTransaction);
getMethodContainerTransactions().put(methodDescriptor, containerTransaction);
}
|
public void | setDistributedTransactionScope(boolean scope)Set the transaction scope of this ejb.
isDistributedTxScope = scope;
|
public void | setEJBLocalObjectImplClassName(java.lang.String name)Sets the EJBLocalObject implementation classname of the ejb.
this.ejbLocalObjectImplClassName = name;
|
public void | setEJBObjectImplClassName(java.lang.String name)Sets the EJBObject implementation classname of the ejb.
this.ejbObjectImplClassName = name;
|
public void | setEjbBundleDescriptor(EjbBundleDescriptor bundleDescriptor)
this.bundleDescriptor = bundleDescriptor;
|
public void | setEjbClassName(java.lang.String ejbClassName)Sets the classname of the ejb.
this.ejbClassName = ejbClassName;
|
public void | setEjbTimeoutMethod(MethodDescriptor method)
timedObjectMethod = method;
|
public void | setLocalHomeImplClassName(java.lang.String name)Sets the Local home implementation classname of the ejb.
this.localHomeImplClassName = name;
|
public void | setMethodContainerTransactions(java.util.Hashtable methodContainerTransactions)Sets the container transactions for all the method descriptors of this ejb. The Hashtable is keyed
by method descriptor and the values are the corresponding container transaction objects..
Throws an Illegal argument if this ejb has transaction type BEAN_TRANSACTION_TYPE.
if (methodContainerTransactions == null || methodContainerTransactions.isEmpty()) {
methodContainerTransactions = null;
} else {
for (Enumeration e = methodContainerTransactions.keys(); e.hasMoreElements();) {
MethodDescriptor methodDescriptor = (MethodDescriptor) e.nextElement();
ContainerTransaction containerTransaction =
(ContainerTransaction) methodContainerTransactions.get(methodDescriptor);
setContainerTransactionFor(methodDescriptor, containerTransaction);
}
}
|
public void | setRemoteHomeImplClassName(java.lang.String name)Sets the remote home implementation classname of the ejb.
this.remoteHomeImplClassName = name;
|
public void | setRunAsIdentity(RunAsIdentityDescriptor desc)
if ( usesCallerIdentity == null || usesCallerIdentity )
throw new IllegalStateException(localStrings.getLocalString(
"exceptioncannotsetrunas",
"Cannot set RunAs identity when using caller identity"));
this.runAsIdentity = desc;
|
public void | setSecurityIdentityDescription(java.lang.String s)Set the description field of security-identity
securityIdentityDescription = s;
|
public abstract void | setTransactionType(java.lang.String transactionType)Set the transaction type of this ejb.
|
public void | setUniqueId(long id)
uniqueId = id;
|
public void | setUsesCallerIdentity(boolean flag)Set the usesCallerIdentity flag
usesCallerIdentity = flag;
|
public void | setUsesDefaultTransaction()Have default method transaction if isBoundsChecking is on.
usesDefaultTransaction = true;
|
private void | updateMethodPermissionForMethod(MethodPermission mp, MethodDescriptor md)Update a method descriptor set of method permission with a new method permission
The new method permission is added to the list of existing method permissions
given it respect the EJB 2.0 paragraph 21.3.2 on priorities of method permissions
// Get the current set of method permissions for that method
Set oldPermissions = getMethodPermissions(md);
if (oldPermissions.isEmpty()) {
// this is easy, just add the new one
addMethodPermissionForMethod(mp, md);
return;
}
// The order of method permssion setting is very important
// EJB 2.0 Spec 21.3.2
// excluded method permission is always used when multiple methos permission are present
// unchecked is considered like a role based method permission and is added to the list
// therefore making the method callable by anyone.
if (mp.isExcluded()) {
// Excluded methods takes precedence on any other form of method permission
// remove all existing method permission...
for (Iterator oldPermissionsItr = oldPermissions.iterator();oldPermissionsItr.hasNext();) {
MethodPermission oldMp = (MethodPermission) oldPermissionsItr.next();
removePermissionedMethod(oldMp, md);
}
// add the excluded
addMethodPermissionForMethod(mp, md);
} else {
if (mp.isUnchecked()) {
// we are trying to add an unchecked method permisison, all role-based
// method permission should be removed since unchecked is now used, if a
// particular method has an excluded method permision, we do not add it
for (Iterator oldPermissionsItr = oldPermissions.iterator();oldPermissionsItr.hasNext();) {
MethodPermission oldMp = (MethodPermission) oldPermissionsItr.next();
if (!oldMp.isExcluded()) {
removePermissionedMethod(oldMp, md);
addMethodPermissionForMethod(mp, md);
}
}
} else {
// we are trying to add a role based method permission. Check that
// unchecked or excluded method permissions have not been set
// and add it to the current list of role based permission
for (Iterator oldPermissionsItr = oldPermissions.iterator();oldPermissionsItr.hasNext();) {
MethodPermission oldMp = (MethodPermission) oldPermissionsItr.next();
if (!oldMp.isExcluded()) {
if (!oldMp.isUnchecked()) {
addMethodPermissionForMethod(mp, md);
}
}
}
}
}
|
public void | visit(com.sun.enterprise.deployment.util.DescriptorVisitor aVisitor)visit the descriptor and all sub descriptors with a DOL visitor implementation
if (aVisitor instanceof EjbVisitor) {
visit((EjbVisitor) aVisitor);
} else {
super.visit(aVisitor);
}
|
public void | visit(com.sun.enterprise.deployment.util.EjbVisitor aVisitor)visit the descriptor and all sub descriptors with a DOL visitor implementation
aVisitor.accept(this);
// Visit all injectables first. In some cases, basic type information
// has to be derived from target inject method or inject field.
for(InjectionCapable injectable :
bundleDescriptor.getInjectableResources(this)) {
aVisitor.accept(injectable);
}
for (Iterator itr = ejbReferences.iterator();itr.hasNext();) {
EjbReference aRef = (EjbReference) itr.next();
aVisitor.accept(aRef);
}
for (Iterator e = getPermissionedMethodsByPermission().keySet().iterator(); e.hasNext();) {
MethodPermission nextPermission = (MethodPermission) e.next();
Set methods = (Set) getPermissionedMethodsByPermission().get(nextPermission);
aVisitor.accept( nextPermission, methods.iterator()) ;
}
if (getStyledPermissionedMethodsByPermission()!=null) {
for (Iterator e = getStyledPermissionedMethodsByPermission().keySet().iterator(); e.hasNext();) {
MethodPermission nextPermission = (MethodPermission) e.next();
Set methods = (Set) getStyledPermissionedMethodsByPermission().get(nextPermission);
aVisitor.accept( nextPermission, methods.iterator()) ;
}
}
for (Iterator e = getRoleReferences().iterator();e.hasNext();) {
RoleReference roleRef = (RoleReference) e.next();
aVisitor.accept( roleRef);
}
for (Iterator e=getMethodContainerTransactions().keySet().iterator();e.hasNext();) {
MethodDescriptor md = (MethodDescriptor) e.next();
ContainerTransaction ct = (ContainerTransaction) getMethodContainerTransactions().get(md);
aVisitor.accept(md, ct);
}
for (Iterator e=getEnvironmentProperties().iterator();e.hasNext();) {
EnvironmentProperty envProp = (EnvironmentProperty) e.next();
aVisitor.accept(envProp);
}
for (Iterator it=getResourceReferenceDescriptors().iterator();
it.hasNext();) {
ResourceReferenceDescriptor next =
(ResourceReferenceDescriptor) it.next();
aVisitor.accept(next);
}
for (Iterator it=getJmsDestinationReferenceDescriptors().iterator();
it.hasNext();) {
JmsDestinationReferenceDescriptor next =
(JmsDestinationReferenceDescriptor) it.next();
aVisitor.accept(next);
}
for (Iterator it=getMessageDestinationReferenceDescriptors().iterator();
it.hasNext();) {
MessageDestinationReferencer next =
(MessageDestinationReferencer) it.next();
aVisitor.accept(next);
}
// If this is a message bean, it can be a message destination
// referencer as well.
if( getType().equals(EjbMessageBeanDescriptor.TYPE) ) {
MessageDestinationReferencer msgDestReferencer =
(MessageDestinationReferencer) this;
if( msgDestReferencer.getMessageDestinationLinkName() != null ) {
aVisitor.accept(msgDestReferencer);
}
}
Set serviceRefs = getServiceReferenceDescriptors();
for (Iterator itr = serviceRefs.iterator();itr.hasNext();) {
aVisitor.accept((ServiceReferenceDescriptor) itr.next());
}
|