[prev in list] [next in list] [prev in thread] [next in thread]
List: jboss-cvs-commits
Subject: [jboss-cvs] jboss/src/main/org/jboss/metadata ApplicationMetaData.java BeanMetaData.java Configurati
From: "Dr. Christoph Georg Jung" <cgjung () users ! sourceforge ! net>
Date: 2003-10-31 18:23:50
[Download RAW message or body]
User: cgjung
Date: 03/10/31 10:23:50
Modified: src/main/org/jboss/metadata ApplicationMetaData.java
BeanMetaData.java ConfigurationMetaData.java
MethodMetaData.java SessionMetaData.java
XmlFileLoader.java
Log:
Initial (working) J2EE1.4/WS4EE1.0 bits (see ChangeNote).
Revision Changes Path
1.37 +35 -29 jboss/src/main/org/jboss/metadata/ApplicationMetaData.java
Index: ApplicationMetaData.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/ApplicationMetaData.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- ApplicationMetaData.java 27 Aug 2003 04:32:30 -0000 1.36
+++ ApplicationMetaData.java 31 Oct 2003 18:23:50 -0000 1.37
@@ -26,8 +26,9 @@
* @author <a href="mailto:peter.antman@tim.se">Peter Antman</a>
* @author <a href="mailto:Scott.Stark@jboss.org">Scott Stark</a>
* @author <a href="mailto:criege@riege.com">Christian Riege</a>
+ * @author <a href="mailto:Christoph.Jung@infor.de">Christoph G. Jung</a>.
*
- * @version $Revision: 1.36 $
+ * @version $Revision: 1.37 $
*/
public class ApplicationMetaData
extends MetaData
@@ -202,35 +203,40 @@
if( docType == null )
{
- // No good, EJB 1.1/2.0 requires a DOCTYPE declaration
- throw new DeploymentException( "ejb-jar.xml must define a " +
- "valid DOCTYPE!" );
- }
-
- String publicId = docType.getPublicId();
- if( publicId == null )
- {
- // We need a public Id
- throw new DeploymentException( "The DOCTYPE declaration in " +
- "ejb-jar.xml must define a PUBLIC id" );
- }
+ // test if this is a 2.1 schema-based descriptor
+ if("http://java.sun.com/xml/ns/j2ee".equals(element.getNamespaceURI())) {
+ ejbVersion=2;
+ } else {
+ // No good, EJB 1.1/2.1 requires a DOCTYPE declaration
+ throw new DeploymentException( "ejb-jar.xml must either obey "+
+ "the right xml schema or define a valid DOCTYPE!" );
+ }
+ } else {
+ String publicId = docType.getPublicId();
+ if( publicId == null )
+ {
+ // We need a public Id
+ throw new DeploymentException( "The DOCTYPE declaration in " +
+ "ejb-jar.xml must define a PUBLIC id" );
+ }
- // Check for a known public Id
- if( publicId.startsWith(
- "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0") )
- {
- ejbVersion = 2;
- }
- else if( publicId.startsWith(
- "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1") )
- {
- ejbVersion = 1;
- }
- else
- {
- // Unknown
- throw new DeploymentException( "Unknown PUBLIC id in " +
- "ejb-jar.xml: " + publicId );
+ // Check for a known public Id
+ if( publicId.startsWith(
+ "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0") )
+ {
+ ejbVersion = 2;
+ }
+ else if( publicId.startsWith(
+ "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1") )
+ {
+ ejbVersion = 1;
+ }
+ else
+ {
+ // Unknown
+ throw new DeploymentException( "Unknown PUBLIC id in " +
+ "ejb-jar.xml: " + publicId );
+ }
}
// find the beans
1.51 +6 -4 jboss/src/main/org/jboss/metadata/BeanMetaData.java
Index: BeanMetaData.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/BeanMetaData.java,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- BeanMetaData.java 27 Aug 2003 04:32:30 -0000 1.50
+++ BeanMetaData.java 31 Oct 2003 18:23:50 -0000 1.51
@@ -36,7 +36,7 @@
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @author <a href="mailto:criege@riege.com">Christian Riege</a>
*
- * @version $Revision: 1.50 $
+ * @version $Revision: 1.51 $
*/
public abstract class BeanMetaData
extends MetaData
@@ -206,11 +206,13 @@
if( invokerBindings == null )
{
// See if there is a container default invoker name
- String defaultName = configuration.getDefaultInvokerName();
- if( defaultName != null )
+ String[] defaultNames = configuration.getInvokers();
+ if( defaultNames.length>0 )
{
invokerBindings = new HashMap();
- invokerBindings.put(defaultName, getJndiName());
+ for(int count=0;count<defaultNames.length;count++) {
+ invokerBindings.put(defaultNames[count], getJndiName());
+ }
}
else
{
1.40 +21 -10 jboss/src/main/org/jboss/metadata/ConfigurationMetaData.java
Index: ConfigurationMetaData.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/ConfigurationMetaData.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- ConfigurationMetaData.java 27 Aug 2003 04:32:30 -0000 1.39
+++ ConfigurationMetaData.java 31 Oct 2003 18:23:50 -0000 1.40
@@ -9,6 +9,8 @@
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
+import java.util.List;
+
import org.jboss.deployment.DeploymentException;
import org.jboss.mx.util.ObjectNameFactory;
import org.w3c.dom.Element;
@@ -16,7 +18,8 @@
/** The configuration information for an EJB container.
* @author <a href="mailto:sebastien.alborini@m4x.org">Sebastien Alborini</a>
* @author <a href="mailto:scott.stark@jboss.org">Scott Stark</a>
- * @version $Revision: 1.39 $
+ * @author <a href="mailto:christoph.jung@infor.de">Christoph G. Jung</a>
+ * @version $Revision: 1.40 $
*/
public class ConfigurationMetaData extends MetaData
{
@@ -25,6 +28,7 @@
public static final String CMP_1x_13 = "Standard CMP EntityBean";
public static final String BMP_13 = "Standard BMP EntityBean";
public static final String STATELESS_13 = "Standard Stateless SessionBean";
+ public static final String STATELESS_14 = "Webservice-Enabled Stateless \
SessionBean";
public static final String STATEFUL_13 = "Standard Stateful SessionBean";
public static final String MESSAGE_DRIVEN_13 = "Standard Message Driven Bean";
@@ -56,8 +60,8 @@
private boolean insertAfterEjbPostCreate = false;
/** The container level security domain */
private String securityDomain;
- /** The container default invoker binding name */
- private String defaultInvokerName;
+ /** The container invoker binding names */
+ private String[] invokerNames;
/** The InstancePool configuration */
private Element containerPoolConf;
/** The InstanceCache configuration */
@@ -104,9 +108,9 @@
return securityDomain;
}
- public String getDefaultInvokerName()
+ public String[] getInvokers()
{
- return defaultInvokerName;
+ return invokerNames;
}
public String getWebClassLoader()
@@ -201,11 +205,18 @@
// set the security domain
securityDomain = getElementContent(getOptionalChild(element, \
"security-domain"), securityDomain);
-
- // Get the container default invoker name
- Element invokerName = getOptionalChild(element, \
"invoker-proxy-binding-name");
- defaultInvokerName = MetaData.getElementContent(invokerName, \
defaultInvokerName);
-
+
+ //Get configured invokers
+ List invokers=new java.util.ArrayList();
+
+ for (Iterator invokerElements = getChildrenByTagName(element, \
"invoker-proxy-binding-name"); invokerElements.hasNext();) + {
+ Element invokerElement = (Element) invokerElements.next();
+ String invokerName = getElementContent(invokerElement);
+ invokers.add(invokerName);
+ } // end of for ()
+ invokerNames=(String[]) invokers.toArray(new String[invokers.size()]);
+
// set the commit option
String commit = getElementContent(getOptionalChild(element, \
"commit-option"), commitOptionToString(commitOption));
1.17 +8 -2 jboss/src/main/org/jboss/metadata/MethodMetaData.java
Index: MethodMetaData.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/MethodMetaData.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- MethodMetaData.java 27 Aug 2003 04:32:30 -0000 1.16
+++ MethodMetaData.java 31 Oct 2003 18:23:50 -0000 1.17
@@ -38,7 +38,7 @@
*
* @author <a href="mailto:sebastien.alborini@m4x.org">Sebastien Alborini</a>
* @author <a href="mailto:Scott.Stark@jboss.org">Scott Stark</a>.
- * @version $Revision: 1.16 $
+ * @version $Revision: 1.17 $
*/
public class MethodMetaData extends MetaData
{
@@ -127,6 +127,8 @@
{ return methodType == InvocationType.LOCALHOME ; }
public boolean isLocalMethod()
{ return methodType == InvocationType.LOCAL ; }
+ public boolean isServiceEndpointMethod()
+ { return methodType == InvocationType.SERVICE_ENDPOINT ; }
public boolean isUnchecked()
{ return unchecked; }
public boolean isExcluded()
@@ -226,9 +228,13 @@
{
methodType = InvocationType.LOCAL;
}
+ else if (methodIntf.equals("ServiceEndpoint"))
+ {
+ methodType = InvocationType.SERVICE_ENDPOINT;
+ }
else
{
- throw new DeploymentException("method-intf tag should be one of: \
'Home', 'Remote', 'LocalHome', 'Local'"); + throw new \
DeploymentException("method-intf tag should be one of: 'Home', 'Remote', 'LocalHome', \
'Local', 'ServiceEndpoint'"); }
}
1.21 +36 -24 jboss/src/main/org/jboss/metadata/SessionMetaData.java
Index: SessionMetaData.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/SessionMetaData.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- SessionMetaData.java 27 Aug 2003 04:32:30 -0000 1.20
+++ SessionMetaData.java 31 Oct 2003 18:23:50 -0000 1.21
@@ -9,15 +9,15 @@
import java.util.HashMap;
import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
import org.jboss.deployment.DeploymentException;
/** The meta data information specific to session beans.
*
* @author <a href="mailto:sebastien.alborini@m4x.org">Sebastien Alborini</a>
- * @author <a href="mailto:Scott_Stark@displayscape.com">Scott Stark</a>.
- * @version $Revision: 1.20 $
+ * @author <a href="mailto:Scott_Stark@displayscape.com">Scott Stark</a>
+ * @author <a href="mailto:Christoph.Jung@infor.de">Christoph G. Jung</a>.
+ * @version $Revision: 1.21 $
*/
public class SessionMetaData extends BeanMetaData
{
@@ -26,9 +26,15 @@
public static final String DEFAULT_CLUSTERED_STATEFUL_INVOKER = \
"clustered-stateful-rmi-invoker";
public static final String DEFAULT_STATELESS_INVOKER = "stateless-rmi-invoker";
public static final String DEFAULT_CLUSTERED_STATELESS_INVOKER = \
"clustered-stateless-rmi-invoker"; + public static final String \
DEFAULT_WEBSERVICE_INVOKER = "session-webservice-invoker";
// Attributes ----------------------------------------------------
+ /** whether it is a stateful or stateless bean */
private boolean stateful;
+ /** the service-endpoint element contains the fully-qualified
+ * name of the session beanīs web service interface
+ */
+ protected String serviceEndpointClass;
// Static --------------------------------------------------------
@@ -41,7 +47,12 @@
// Public --------------------------------------------------------
public boolean isStateful() { return stateful; }
public boolean isStateless() { return !stateful; }
-
+ public boolean isWebservice() { return getServiceEndpoint()!=null; }
+
+ public String getServiceEndpoint() {
+ return serviceEndpointClass;
+ }
+
public String getDefaultConfigurationName()
{
if (isStateful()) {
@@ -52,36 +63,35 @@
} else {
if (this.isClustered())
return ConfigurationMetaData.CLUSTERED_STATELESS_13;
+ else if(this.isWebservice())
+ return ConfigurationMetaData.STATELESS_14;
else
return ConfigurationMetaData.STATELESS_13;
}
}
-
- protected void defaultInvokerBindings()
- {
+ protected void defaultInvokerBindings() {
invokerBindings = new HashMap();
- if (isClustered())
- {
- if (stateful)
- {
- invokerBindings.put(DEFAULT_CLUSTERED_STATEFUL_INVOKER, \
getJndiName()); + if (isClustered()) {
+ if (stateful) {
+ invokerBindings.put(
+ DEFAULT_CLUSTERED_STATEFUL_INVOKER,
+ getJndiName());
+ } else {
+ invokerBindings.put(
+ DEFAULT_CLUSTERED_STATELESS_INVOKER,
+ getJndiName());
}
- else
- {
- invokerBindings.put(DEFAULT_CLUSTERED_STATELESS_INVOKER, \
getJndiName());
- }
- }
- else
- {
- if (stateful)
- {
+ if (isWebservice())
+ invokerBindings.put(DEFAULT_WEBSERVICE_INVOKER, getJndiName());
+ } else {
+ if (stateful) {
invokerBindings.put(DEFAULT_STATEFUL_INVOKER, getJndiName());
- }
- else
- {
+ } else {
invokerBindings.put(DEFAULT_STATELESS_INVOKER, getJndiName());
}
+ if (isWebservice())
+ invokerBindings.put(DEFAULT_WEBSERVICE_INVOKER, getJndiName());
}
}
@@ -107,6 +117,8 @@
} else {
throw new DeploymentException("transaction type should be 'Bean' or \
'Container'"); }
+
+ serviceEndpointClass = getElementContent(getOptionalChild(element, \
"service-endpoint")); }
// Package protected ---------------------------------------------
1.41 +12 -1 jboss/src/main/org/jboss/metadata/XmlFileLoader.java
Index: XmlFileLoader.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/XmlFileLoader.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- XmlFileLoader.java 27 Aug 2003 04:32:30 -0000 1.40
+++ XmlFileLoader.java 31 Oct 2003 18:23:50 -0000 1.41
@@ -33,7 +33,8 @@
* @author <a href="mailto:WolfgangWerner@gmx.net">Wolfgang Werner</a>
* @author <a href="mailto:Darius.D@jbees.com">Darius Davidavicius</a>
* @author <a href="mailto:scott.stark@jboss.org">Scott Stark</a>
- * @version $Revision: 1.40 $
+ * @author <a href="mailto:Christoph.Jung@infor.de">Christoph G. Jung</a>.
+ * @version $Revision: 1.41 $
*/
public class XmlFileLoader
{
@@ -284,6 +285,16 @@
// Enable DTD validation based on our validateDTDs flag
docBuilderFactory.setValidating(validateDTDs);
+ // make the parser namespace-aware in case we deal
+ // with ejb2.1 descriptors, will not break dtd parsing in any way
+ // in which case there would be just a default namespace
+ docBuilderFactory.setNamespaceAware(true);
+ // this will (along JAXP in conjunction with
+ // validation+namespace-awareness) enable xml schema checking.
+ // Will currently fail because some J2EE1.4/W3C schemas
+ // are still lacking.
+ //docBuilderFactory.setAttribute
+ // ("http://java.sun.com/xml/jaxp/properties/schemaLanguage","http://www.w3.org/2001/XMLSchema");
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
JBossEntityResolver lr = new JBossEntityResolver();
LocalErrorHandler eh = new LocalErrorHandler( inPath, lr );
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
jboss-cvs-commits mailing list
jboss-cvs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-cvs-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic