[jboss-cvs] JBossAS SVN: r61159 - branches/tdiesler/trunk/server/src/main/org/jboss/metadata.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Mar 6 15:51:53 EST 2007


Author: thomas.diesler at jboss.com
Date: 2007-03-06 15:51:53 -0500 (Tue, 06 Mar 2007)
New Revision: 61159

Modified:
   branches/tdiesler/trunk/server/src/main/org/jboss/metadata/DDObjectFactory.java
Log:
partial commit

Modified: branches/tdiesler/trunk/server/src/main/org/jboss/metadata/DDObjectFactory.java
===================================================================
--- branches/tdiesler/trunk/server/src/main/org/jboss/metadata/DDObjectFactory.java	2007-03-06 20:49:14 UTC (rev 61158)
+++ branches/tdiesler/trunk/server/src/main/org/jboss/metadata/DDObjectFactory.java	2007-03-06 20:51:53 UTC (rev 61159)
@@ -1,32 +1,29 @@
 /*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/ 
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.jboss.metadata;
 
 import javax.persistence.PersistenceContextType;
 
-import org.jboss.metadata.serviceref.HandlerMetaData;
-import org.jboss.metadata.serviceref.InitParamMetaData;
-import org.jboss.metadata.serviceref.PortComponentRefMetaData;
-import org.jboss.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.util.NotImplementedException;
 import org.jboss.xb.binding.ObjectModelFactory;
 import org.jboss.xb.binding.UnmarshallingContext;
 import org.xml.sax.Attributes;
@@ -39,145 +36,98 @@
  */
 public abstract class DDObjectFactory implements ObjectModelFactory
 {
-   public Object newChild(PersistenceUnitRef ref,
-                          UnmarshallingContext navigator, String namespaceURI, String localName,
-                          Attributes attrs)
+   public Object newChild(PersistenceUnitRef ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
    {
       return newRefChild(ref, localName);
    }
 
-   public Object newChild(PersistenceContextRef ref,
-                          UnmarshallingContext navigator, String namespaceURI, String localName,
-                          Attributes attrs)
+   public Object newChild(PersistenceContextRef ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
    {
       return newRefChild(ref, localName);
    }
 
-   public Object newChild(EnvEntryMetaData ref,
-                          UnmarshallingContext navigator, String namespaceURI, String localName,
-                          Attributes attrs)
+   public Object newChild(EnvEntryMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
    {
       return newRefChild(ref, localName);
    }
 
-   public Object newChild(EjbRefMetaData ref,
-                          UnmarshallingContext navigator, String namespaceURI, String localName,
-                          Attributes attrs)
+   public Object newChild(EjbRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
    {
       return newRefChild(ref, localName);
    }
 
-   public Object newChild(EjbLocalRefMetaData ref,
-                          UnmarshallingContext navigator, String namespaceURI, String localName,
-                          Attributes attrs)
+   public Object newChild(EjbLocalRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
    {
       return newRefChild(ref, localName);
    }
 
-   public Object newChild(ResourceRefMetaData ref,
-                          UnmarshallingContext navigator, String namespaceURI, String localName,
-                          Attributes attrs)
+   public Object newChild(ResourceRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
    {
       return newRefChild(ref, localName);
    }
 
-   public Object newChild(ResourceEnvRefMetaData ref,
-                          UnmarshallingContext navigator, String namespaceURI, String localName,
-                          Attributes attrs)
+   public Object newChild(ResourceEnvRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
    {
       return newRefChild(ref, localName);
    }
 
-   public Object newChild(MessageDestinationRefMetaData ref,
-                          UnmarshallingContext navigator, String namespaceURI, String localName,
-                          Attributes attrs)
+   public Object newChild(MessageDestinationRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
    {
       return newRefChild(ref, localName);
    }
 
-   public Object newChild(ServiceRefMetaData ref,
-                          UnmarshallingContext navigator, String namespaceURI, String localName,
-                          Attributes attrs)
+   public Object newChild(JndiRef ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
    {
-      Object child = newRefChild(ref, localName);
-      if (localName.equals("port-component-ref"))
-         child = new PortComponentRefMetaData(ref);
-      else if (localName.equals("handler"))
-         child = new HandlerMetaData();
-
-      return child;
-   }
-
-   public Object newChild(JndiRef ref,
-                          UnmarshallingContext navigator, String namespaceURI, String localName,
-                          Attributes attrs)
-   {
       return newRefChild(ref, localName);
    }
 
-   public void addChild(PersistenceUnitRef parent, InjectionTarget target,
-                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   public void addChild(PersistenceUnitRef parent, InjectionTarget target, UnmarshallingContext navigator, String namespaceURI, String localName)
    {
       parent.setInjectionTarget(target);
    }
 
-   public void addChild(PersistenceContextRef parent, InjectionTarget target,
-                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   public void addChild(PersistenceContextRef parent, InjectionTarget target, UnmarshallingContext navigator, String namespaceURI, String localName)
    {
       parent.setInjectionTarget(target);
    }
 
-   public void addChild(EnvEntryMetaData parent, InjectionTarget target,
-                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   public void addChild(EnvEntryMetaData parent, InjectionTarget target, UnmarshallingContext navigator, String namespaceURI, String localName)
    {
       parent.setInjectionTarget(target);
    }
 
-   public void addChild(EjbRefMetaData parent, InjectionTarget target,
-                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   public void addChild(EjbRefMetaData parent, InjectionTarget target, UnmarshallingContext navigator, String namespaceURI, String localName)
    {
       parent.setInjectionTarget(target);
    }
 
-   public void addChild(EjbLocalRefMetaData parent, InjectionTarget target,
-                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   public void addChild(EjbLocalRefMetaData parent, InjectionTarget target, UnmarshallingContext navigator, String namespaceURI, String localName)
    {
       parent.setInjectionTarget(target);
    }
 
-   public void addChild(ResourceRefMetaData parent, InjectionTarget target,
-                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   public void addChild(ResourceRefMetaData parent, InjectionTarget target, UnmarshallingContext navigator, String namespaceURI, String localName)
    {
       parent.setInjectionTarget(target);
    }
 
-   public void addChild(ResourceEnvRefMetaData parent, InjectionTarget target,
-                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   public void addChild(ResourceEnvRefMetaData parent, InjectionTarget target, UnmarshallingContext navigator, String namespaceURI, String localName)
    {
       parent.setInjectionTarget(target);
    }
 
-   public void addChild(MessageDestinationRefMetaData parent, InjectionTarget target,
-                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   public void addChild(MessageDestinationRefMetaData parent, InjectionTarget target, UnmarshallingContext navigator, String namespaceURI, String localName)
    {
       parent.setInjectionTarget(target);
    }
 
-   public void addChild(ServiceRefMetaData parent, InjectionTarget target,
-                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   public void addChild(JndiRef parent, InjectionTarget target, UnmarshallingContext navigator, String namespaceURI, String localName)
    {
       parent.setInjectionTarget(target);
    }
 
-   public void addChild(JndiRef parent, InjectionTarget target,
-                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   public void setValue(EjbLocalRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
-      parent.setInjectionTarget(target);
-   }
-
-   public void setValue(EjbLocalRefMetaData ref, UnmarshallingContext navigator,
-                        String namespaceURI, String localName, String value)
-   {
       if (localName.equals("ejb-ref-name"))
       {
          ref.setName(getValue(localName, value));
@@ -208,8 +158,7 @@
       }
    }
 
-   public void setValue(EjbRefMetaData ref, UnmarshallingContext navigator,
-                        String namespaceURI, String localName, String value)
+   public void setValue(EjbRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
       if (localName.equals("ejb-ref-name"))
       {
@@ -244,8 +193,7 @@
    /**
     * Called when a child element with simple content is read for DD.
     */
-   public void setValue(InjectionTarget target, UnmarshallingContext navigator,
-                        String namespaceURI, String localName, String value)
+   public void setValue(InjectionTarget target, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
       if (localName.equals("injection-target-class"))
       {
@@ -260,8 +208,7 @@
    /**
     * Called when a child element with simple content is read for DD.
     */
-   public void setValue(MessageDestinationRefMetaData ref, UnmarshallingContext navigator,
-                        String namespaceURI, String localName, String value)
+   public void setValue(MessageDestinationRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
       if (localName.equals("description"))
       {
@@ -289,8 +236,7 @@
       }
    }
 
-   public void setValue(EnvEntryMetaData entry, UnmarshallingContext navigator,
-                        String namespaceURI, String localName, String value)
+   public void setValue(EnvEntryMetaData entry, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
       if (localName.equals("description"))
       {
@@ -310,16 +256,13 @@
       }
    }
 
-   public void setValue(ResourceEnvRefMetaData envRef, UnmarshallingContext navigator,
-                        String namespaceURI, String localName, String value)
+   public void setValue(ResourceEnvRefMetaData envRef, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
-      if (localName.equals("res-ref-name")
-              || localName.equals("resource-env-ref-name"))
+      if (localName.equals("res-ref-name") || localName.equals("resource-env-ref-name"))
       {
          envRef.setRefName(getValue(localName, value));
       }
-      else if (localName.equals("res-type")
-              || localName.equals("resource-env-ref-type"))
+      else if (localName.equals("res-type") || localName.equals("resource-env-ref-type"))
       {
          envRef.setType(getValue(localName, value));
       }
@@ -337,16 +280,13 @@
       }
    }
 
-   public void setValue(ResourceRefMetaData ref, UnmarshallingContext navigator,
-                        String namespaceURI, String localName, String value)
+   public void setValue(ResourceRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
-      if (localName.equals("res-ref-name")
-              || localName.equals("resource-env-ref-name"))
+      if (localName.equals("res-ref-name") || localName.equals("resource-env-ref-name"))
       {
          ref.setRefName(getValue(localName, value));
       }
-      else if (localName.equals("res-type")
-              || localName.equals("resource-env-ref-type"))
+      else if (localName.equals("res-type") || localName.equals("resource-env-ref-type"))
       {
          ref.setType(getValue(localName, value));
       }
@@ -372,81 +312,6 @@
       }
    }
 
-   public void setValue(ServiceRefMetaData ref, UnmarshallingContext navigator,
-                        String namespaceURI, String localName, String value)
-   {
-      /* Standard properties */
-      if (localName.equals("service-ref-name"))
-      {
-         ref.setServiceRefName(getValue(localName, value));
-      }
-      else if (localName.equals("service-res-type"))
-      {
-         ref.setServiceResType(getValue(localName, value));
-      }
-      else if (localName.equals("service-interface"))
-      {
-         ref.setServiceInterface(getValue(localName, value));
-      }
-      else if (localName.equals("service-qname"))
-      {
-         ref.setServiceQName(navigator.resolveQName(value));
-      }
-      else if (localName.equals("wsdl-file"))
-      {
-         ref.setWsdlFile(getValue(localName, value));
-      }
-      else if (localName.equals("jaxrpc-mapping-file"))
-      {
-         ref.setMappingFile(getValue(localName, value));
-      }
-      
-      /* JBoss properties */
-      else if (localName.equals("config-name"))
-      {
-         ref.setConfigName(value);
-      }
-      else if (localName.equals("config-file"))
-      {
-         ref.setConfigFile(value);
-      }
-      else if (localName.equals("wsdl-override"))
-      {
-         ref.setWsdlOverride(value);
-      }
-   }
-
-   public void addChild(ServiceRefMetaData parent, PortComponentRefMetaData pcRef, UnmarshallingContext navigator, String namespaceURI, String localName)
-   {
-      parent.addPortComponentRef(pcRef);
-   }
-
-   public void addChild(ServiceRefMetaData parent, HandlerMetaData handler, UnmarshallingContext navigator, String namespaceURI, String localName)
-   {
-      parent.addHandler(handler);
-   }
-
-   public void setValue(PortComponentRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
-   {
-      if (localName.equals("service-endpoint-interface"))
-      {
-         ref.setServiceEndpointInterface(value);
-      }
-      else if (localName.equals("port-component-link"))
-      {
-         ref.setPortComponentLink(value);
-      }
-   }
-   
-   public Object newChild(PortComponentRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
-   {
-      Object child = null;
-      if (localName.equals("call-property"))
-         child = new NameValuePair();
-      
-      return child;
-   }
-
    public void setValue(NameValuePair ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
       if (localName.equals("prop-name"))
@@ -458,73 +323,17 @@
          ref.setValue(value);
       }
    }
-   
-   public void addChild(PortComponentRefMetaData parent, NameValuePair property, UnmarshallingContext navigator, String namespaceURI, String localName)
-   {
-      parent.addCallProperty(property.getName(), property.getValue());
-   }
-   
-   public void setValue(HandlerMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
-   {
-      if (localName.equals("handler-name"))
-      {
-         ref.setHandlerName(value);
-      }
-      else if (localName.equals("handler-class"))
-      {
-         ref.setHandlerClass(value);
-      }
-      else if (localName.equals("soap-header"))
-      {
-         ref.addSoapHeader(navigator.resolveQName(value));
-      }
-      else if (localName.equals("soap-role"))
-      {
-         ref.addSoapRole(value);
-      }
-      else if (localName.equals("port-name"))
-      {
-         ref.addPortName(value);
-      }
-   }
-   
-   public Object newChild(HandlerMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
-   {
-      Object child = null;
-      if (localName.equals("init-param"))
-         child = new InitParamMetaData();
-      
-      return child;
-   }
 
-   public void addChild(HandlerMetaData parent, InitParamMetaData param, UnmarshallingContext navigator, String namespaceURI, String localName)
+
+   public void setValue(SecurityRoleMetaData role, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
-      parent.addInitParam(param);
-   }
-   
-   public void setValue(InitParamMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
-   {
-      if (localName.equals("param-name"))
-      {
-         ref.setParamName(value);
-      }
-      else if (localName.equals("param-value"))
-      {
-         ref.setParamValue(value);
-      }
-   }
-   
-   public void setValue(SecurityRoleMetaData role, UnmarshallingContext navigator,
-                        String namespaceURI, String localName, String value)
-   {
       if (localName.equals("role-name"))
       {
          role.setRoleName(getValue(localName, value));
       }
    }
 
-   public void setValue(JndiRef ref, UnmarshallingContext navigator,
-                        String namespaceURI, String localName, String value)
+   public void setValue(JndiRef ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
       if (localName.equals("mapped-name"))
       {
@@ -536,8 +345,7 @@
       }
    }
 
-   public void setValue(RunAs runAs, UnmarshallingContext navigator,
-                        String namespaceURI, String localName, String value)
+   public void setValue(RunAs runAs, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
       if (localName.equals("role-name"))
       {
@@ -545,8 +353,7 @@
       }
    }
 
-   public void setValue(SecurityRoleRefMetaData ref, UnmarshallingContext navigator,
-                        String namespaceURI, String localName, String value)
+   public void setValue(SecurityRoleRefMetaData ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
       if (localName.equals("role-name"))
       {
@@ -558,8 +365,7 @@
       }
    }
 
-   public void setValue(Listener listener, UnmarshallingContext navigator,
-                        String namespaceURI, String localName, String value)
+   public void setValue(Listener listener, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
       if (localName.equals("listener-class"))
       {
@@ -567,8 +373,7 @@
       }
    }
 
-   public void setValue(MessageDestinationMetaData destination, UnmarshallingContext navigator,
-                        String namespaceURI, String localName, String value)
+   public void setValue(MessageDestinationMetaData destination, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
       if (localName.equals("message-destination-name"))
       {
@@ -580,8 +385,7 @@
       }
    }
 
-   public void setValue(PersistenceUnitRef ref, UnmarshallingContext navigator,
-                        String namespaceURI, String localName, String value)
+   public void setValue(PersistenceUnitRef ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
       if (localName.equals("persistence-unit-ref-name"))
       {
@@ -627,7 +431,7 @@
       }
       else if (localName.equals("service-ref"))
       {
-         child = new ServiceRefMetaData();
+         throw new NotImplementedException();
       }
       else if (localName.equals("jndi-ref"))
       {
@@ -662,8 +466,7 @@
       return child;
    }
 
-   public void setValue(PersistenceContextRef ref, UnmarshallingContext navigator,
-                        String namespaceURI, String localName, String value)
+   public void setValue(PersistenceContextRef ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
    {
       if (localName.equals("persistence-context-ref-name"))
       {
@@ -673,7 +476,7 @@
       {
          ref.setUnitName(getValue(localName, value));
       }
-      else if(localName.equals("persistence-context-type"))
+      else if (localName.equals("persistence-context-type"))
       {
          if (value.toLowerCase().equals("transaction"))
          {
@@ -685,7 +488,7 @@
          }
       }
    }
-   
+
    protected String getValue(String name, String value)
    {
       return value;




More information about the jboss-cvs-commits mailing list