[jboss-dev-forums] [Design of POJO Server] - [jboss-metadata] Cannot get at DeploymentSummary set in Mapp

ALRubinger do-not-reply at jboss.com
Sun Jun 15 13:55:55 EDT 2008


Issue is:

http://jira.jboss.com/jira/browse/JBMETA-58

The MappedReferenceMetadataResolverDeployer, in "mapEjbs", sets a DeploymentSummary in JBossMetaData, where the underlying implementation is the JBossMetaDataWrapper.

However, when attempting to obtain the DeploymentSummary in JBossEnterpriseBeanMetadata.determineResolvedJndiName(), the summary returned is that from the wrapped object, not the wrapper itself.  Far as I can tell, the intention is for the wrapper to provide a read-only view.

So I cannot get at the CL required to create a DefaultJndiBindingPolicy:

      // Obtain the Deployment Summary
  |       DeploymentSummary dsummary = getJBossMetaData().getDeploymentSummary(); //This returns the wrapped metadata's summary, not the wrapper's one which was set in the deployer
  |       
  |       // Initialize the Default JNDI Binding Policy
  |       DefaultJndiBindingPolicy policy = null;
  |       
  |       // If Deployment Summary is defined
  |       if (dsummary != null)
  |       {
  |          try
  |          {
  |             /*
  |              * Create a JNDI Policy from the Deployment Summary
  |              */ 
  |             
  |             // Obtain the JNDI Policy Class Name
  |             String jndiPolicyClassName = this.getJndiBindingPolicy();
  |             if (jndiPolicyClassName != null && jndiPolicyClassName.trim().equals(""))
  |             {
  |                jndiPolicyClassName = null;
  |             }
  |             
  |             // Get the CL
  |             ClassLoader loader = dsummary.getLoader(); //Here's where I need the correct CL
  |             
  |             // Load the Class
  |             Class<? extends DefaultJndiBindingPolicy> jndiPolicyClass = null;
  |             if (jndiPolicyClassName != null)
  |             {
  |                Class<?> clazz = loader.loadClass(jndiPolicyClassName);
  |                assert DefaultJndiBindingPolicy.class.isAssignableFrom(clazz) : "Specified " + jndiPolicyClassName
  |                      + " is not of expected type " + DefaultJndiBindingPolicy.class.getName();
  |                jndiPolicyClass = (Class<? extends DefaultJndiBindingPolicy>) clazz;
  |             }
  |             
  |             // Create Policy
  |             policy = createPolicy(loader, jndiPolicyClass);
  |          }
  |          catch (Exception e)
  |          {
  |          }
  |       }

How can I resolve this without breaking the intention of the Wrapper to provide a read-only view?

S,
ALR

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158227#4158227

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4158227



More information about the jboss-dev-forums mailing list