FileDocCategorySizeDatePackage
JndiEnvironmentRefsGroupDescriptor.javaAPI DocGlassfish v2 API16703Fri May 04 22:31:22 BST 2007com.sun.enterprise.deployment

JndiEnvironmentRefsGroupDescriptor

public abstract class JndiEnvironmentRefsGroupDescriptor extends Descriptor implements com.sun.enterprise.deployment.types.MessageDestinationReferenceContainer, com.sun.enterprise.deployment.types.ResourceReferenceContainer, WritableJndiNameEnvironment, com.sun.enterprise.deployment.types.EjbReferenceContainer
Contains information about jndiEnvironmentRefsGroup.

Fields Summary
private static com.sun.enterprise.util.LocalStringManagerImpl
localStrings
private static final Logger
_logger
protected Map
callbackDescriptors
protected EjbBundleDescriptor
bundleDescriptor
protected Set
environmentProperties
protected Set
ejbReferences
protected Set
jmsDestReferences
protected Set
messageDestReferences
protected Set
resourceReferences
protected Set
serviceReferences
protected Set
entityManagerFactoryReferences
protected Set
entityManagerReferences
Constructors Summary
Methods Summary
public voidaddCallbackDescriptor(com.sun.enterprise.deployment.LifecycleCallbackDescriptor.CallbackType type, LifecycleCallbackDescriptor llcDesc)


    // callbacks
       
              
        Set<LifecycleCallbackDescriptor> llcDescs =
            getCallbackDescriptors(type);
        boolean found = false;       
        for (LifecycleCallbackDescriptor llcD : llcDescs) {
            if ((llcDesc.getLifecycleCallbackClass() != null) &&
                llcDesc.getLifecycleCallbackClass().equals(
                    llcD.getLifecycleCallbackClass())) {
                found = true;
            }
        }

        if (!found) {
            llcDescs.add(llcDesc);
        }
    
public voidaddCallbackDescriptors(com.sun.enterprise.deployment.LifecycleCallbackDescriptor.CallbackType type, java.util.Set lccSet)

        for (LifecycleCallbackDescriptor lcc : lccSet) {
            addCallbackDescriptor(type, lcc);
        }
    
public voidaddEjbReferenceDescriptor(com.sun.enterprise.deployment.types.EjbReference ejbReference)

	this.getEjbReferenceDescriptors().add(ejbReference);
	ejbReference.setReferringBundleDescriptor(getEjbBundleDescriptor());
    
public voidaddEntityManagerFactoryReferenceDescriptor(EntityManagerFactoryReferenceDescriptor reference)

        if( getEjbBundleDescriptor() != null ) {
            reference.setReferringBundleDescriptor
                (getEjbBundleDescriptor());
        }
        this.getEntityManagerFactoryReferenceDescriptors().add(reference);
    
public voidaddEntityManagerReferenceDescriptor(EntityManagerReferenceDescriptor reference)

        if( getEjbBundleDescriptor() != null ) {
            reference.setReferringBundleDescriptor
                (getEjbBundleDescriptor());
        }
        this.getEntityManagerReferenceDescriptors().add(reference);
    
public voidaddEnvironmentProperty(EnvironmentProperty environmentProperty)

	this.getEnvironmentProperties().add(environmentProperty);
    
public voidaddJmsDestinationReferenceDescriptor(JmsDestinationReferenceDescriptor jmsDestinationReference)

	this.getJmsDestinationReferenceDescriptors().add(jmsDestinationReference);
    
public voidaddMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor msgDestReference)

        if( getEjbBundleDescriptor() != null ) {
            msgDestReference.setReferringBundleDescriptor
                (getEjbBundleDescriptor());
        }
        this.getMessageDestinationReferenceDescriptors().add(msgDestReference);
    
public voidaddPostConstructDescriptor(LifecycleCallbackDescriptor lcDesc)

        addCallbackDescriptor(CallbackType.POST_CONSTRUCT, lcDesc);
    
public voidaddPreDestroyDescriptor(LifecycleCallbackDescriptor lcDesc)

        addCallbackDescriptor(CallbackType.PRE_DESTROY, lcDesc);
    
public voidaddResourceReferenceDescriptor(ResourceReferenceDescriptor resourceReference)

	this.getResourceReferenceDescriptors().add(resourceReference);
    
public voidaddServiceReferenceDescriptor(ServiceReferenceDescriptor serviceReference)

        serviceReference.setBundleDescriptor(getEjbBundleDescriptor());
        this.getServiceReferenceDescriptors().add(serviceReference);
    
public java.util.SetgetCallbackDescriptors(com.sun.enterprise.deployment.LifecycleCallbackDescriptor.CallbackType type)

        Set<LifecycleCallbackDescriptor> lccDescs =
            callbackDescriptors.get(type);
        if (lccDescs == null) {
            lccDescs = new HashSet<LifecycleCallbackDescriptor>();
            callbackDescriptors.put(type, lccDescs);
        }
        return lccDescs;
    
public EjbBundleDescriptorgetEjbBundleDescriptor()

	return this.bundleDescriptor;
    
public com.sun.enterprise.deployment.types.EjbReferencegetEjbReference(java.lang.String name)

	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.exceptionhasnoejbrefbyname",
                "This class has no ejb reference by the name of {0}",
                new Object[] {name}));
    
public java.util.SetgetEjbReferenceDescriptors()

	if (this.ejbReferences == null) {
	    this.ejbReferences = new OrderedSet();
	}
	return this.ejbReferences = new OrderedSet(this.ejbReferences);
    
public EntityManagerFactoryReferenceDescriptorgetEntityManagerFactoryReferenceByName(java.lang.String name)

	for (EntityManagerFactoryReferenceDescriptor next :
             getEntityManagerFactoryReferenceDescriptors()) {

	    if (next.getName().equals(name)) {
		return next;
	    }
	}
	throw new IllegalArgumentException(localStrings.getLocalString(
                "enterprise.deployment.exceptionhasnoentitymgrfactoryrefbyname",
                "This class has no entity manager factory reference by the name of {0}",
                new Object[] {name}));
    
public java.util.SetgetEntityManagerFactoryReferenceDescriptors()

        if( this.entityManagerFactoryReferences == null ) {
            this.entityManagerFactoryReferences = 
                new HashSet<EntityManagerFactoryReferenceDescriptor>();
        }
        return entityManagerFactoryReferences; 
    
public EntityManagerReferenceDescriptorgetEntityManagerReferenceByName(java.lang.String name)

	for (EntityManagerReferenceDescriptor next :
             getEntityManagerReferenceDescriptors()) {

	    if (next.getName().equals(name)) {
		return next;
	    }
	}
	throw new IllegalArgumentException(localStrings.getLocalString(
                "enterprise.deployment.exceptionhasnoentitymgrrefbyname",
                "This class has no entity manager reference by the name of {0}",
                new Object[] {name}));
    
public java.util.SetgetEntityManagerReferenceDescriptors()

        if( this.entityManagerReferences == null ) {
            this.entityManagerReferences = 
                new HashSet<EntityManagerReferenceDescriptor>();
        }
        return entityManagerReferences; 
    
public java.util.SetgetEnvironmentProperties()

	if (this.environmentProperties == null) {
	    this.environmentProperties = new OrderedSet();
	}
	return this.environmentProperties = new OrderedSet(this.environmentProperties);
    
public EnvironmentPropertygetEnvironmentPropertyByName(java.lang.String name)

	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.exceptionhasnoenvpropertybyname",
                "This class has no environment property by the name of {0}",
                new Object[] {name}));
    
public java.util.ListgetInjectableResourcesByClass(java.lang.String className)

        throw new UnsupportedOperationException();
    
public InjectionInfogetInjectionInfoByClass(java.lang.String className)

        throw new UnsupportedOperationException();
    
public JmsDestinationReferenceDescriptorgetJmsDestinationReferenceByName(java.lang.String name)

	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.exceptionhasnojmsdestrefbyname",
                "This class has no resource environment reference by the name of {0}",
                new Object[] {name}));
    
public java.util.SetgetJmsDestinationReferenceDescriptors()

	if (this.jmsDestReferences == null) {
	    this.jmsDestReferences = new OrderedSet();
	}
	return this.jmsDestReferences = new OrderedSet(this.jmsDestReferences);
    
public MessageDestinationReferenceDescriptorgetMessageDestinationReferenceByName(java.lang.String name)

	for (Iterator itr = 
                 this.getMessageDestinationReferenceDescriptors().iterator(); 
             itr.hasNext();) {
	    MessageDestinationReferenceDescriptor mdr = 
                (MessageDestinationReferenceDescriptor) itr.next();
	    if (mdr.getName().equals(name)) {
		return mdr;
	    }
	}
	throw new IllegalArgumentException(localStrings.getLocalString(
                "enterprise.deployment.exceptionhasnomsgdestrefbyname",
                "This class has no message destination reference by the name of {0}",
                new Object[] {name}));
    
public java.util.SetgetMessageDestinationReferenceDescriptors()

        if( this.messageDestReferences == null ) {
            this.messageDestReferences = new OrderedSet();
        }
        return this.messageDestReferences = 
            new OrderedSet(this.messageDestReferences);
    
public LifecycleCallbackDescriptorgetPostConstructDescriptorByClass(java.lang.String className)

        throw new UnsupportedOperationException();
    
public java.util.SetgetPostConstructDescriptors()

        return getCallbackDescriptors(CallbackType.POST_CONSTRUCT);
    
public LifecycleCallbackDescriptorgetPreDestroyDescriptorByClass(java.lang.String className)

        throw new UnsupportedOperationException();
    
public java.util.SetgetPreDestroyDescriptors()

        return getCallbackDescriptors(CallbackType.PRE_DESTROY);
    
public ResourceReferenceDescriptorgetResourceReferenceByName(java.lang.String name)

	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.exceptionhasnoresourcerefbyname",
                "This class has no resource reference by the name of {0}",
                new Object[] {name}));
    
public java.util.SetgetResourceReferenceDescriptors()

	if (this.resourceReferences == null) {
	    this.resourceReferences = new OrderedSet();
	}
	return this.resourceReferences = new OrderedSet(this.resourceReferences);
    
public ServiceReferenceDescriptorgetServiceReferenceByName(java.lang.String name)

	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.exceptionhasnoservicerefbyname",
                "This class has no service reference by the name of {0}",
                new Object[] {name}));
    
public java.util.SetgetServiceReferenceDescriptors()

        if( this.serviceReferences == null ) {
            this.serviceReferences = new OrderedSet();
        }
        return this.serviceReferences = new OrderedSet(this.serviceReferences);
    
public booleanhasCallbackDescriptor(com.sun.enterprise.deployment.LifecycleCallbackDescriptor.CallbackType type)

        return (getCallbackDescriptors(type).size() > 0);
    
public voidremoveEjbReferenceDescriptor(com.sun.enterprise.deployment.types.EjbReference ejbReference)

	this.getEjbReferenceDescriptors().remove(ejbReference);
	ejbReference.setReferringBundleDescriptor(null);
    
public voidremoveEnvironmentProperty(EnvironmentProperty environmentProperty)

	this.getEnvironmentProperties().remove(environmentProperty);
    
public voidremoveJmsDestinationReferenceDescriptor(JmsDestinationReferenceDescriptor jmsDestinationReference)

	this.getJmsDestinationReferenceDescriptors().remove(jmsDestinationReference);
    
public voidremoveMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor msgDestRef)

 
        this.getMessageDestinationReferenceDescriptors().remove(msgDestRef);
    
public voidremoveResourceReferenceDescriptor(ResourceReferenceDescriptor resourceReference)

	this.getResourceReferenceDescriptors().remove(resourceReference);
    
public voidremoveServiceReferenceDescriptor(ServiceReferenceDescriptor serviceReference)

        this.getServiceReferenceDescriptors().remove(serviceReference);
    
public voidsetEjbBundleDescriptor(EjbBundleDescriptor bundleDescriptor)

	this.bundleDescriptor = bundleDescriptor;