[jboss-cvs] JBossAS SVN: r65433 - in projects/metadata/trunk/src: main/java/org/jboss/deployment and 6 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sun Sep 16 17:53:31 EDT 2007
Author: alex.loubyansky at jboss.com
Date: 2007-09-16 17:53:31 -0400 (Sun, 16 Sep 2007)
New Revision: 65433
Added:
projects/metadata/trunk/src/main/java/org/jboss/deployment/
projects/metadata/trunk/src/main/java/org/jboss/deployment/DeploymentException.java
projects/metadata/trunk/src/main/java/org/jboss/invocation/
projects/metadata/trunk/src/main/java/org/jboss/invocation/InvocationType.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/ActivationConfigPropertyMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/ApplicationMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/AssemblyDescriptorMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/BeanMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/CMPFieldIterator.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/CacheInvalidationConfigMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/ClusterConfigMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/ConfigurationMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/EjbLocalRefMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/EjbRefMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/EntityMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/EnvEntryMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/ExcludedMethodMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/ExcludedMethodMetaDataIterator.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/InvokerBindingsIterator.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/InvokerProxyBindingMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/IorSecurityConfigMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/MessageDestinationMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/MessageDestinationRefMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/MessageDrivenMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/MethodAttributes.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/MethodMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/OldMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/OldMetaDataIterator.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/OldMetaDataWithOverride.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/PermissionMethodMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/PermissionMethodMetaDataIterator.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/QueryMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/RelationMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/RelationshipRoleMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/ResourceEnvRefMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/ResourceRefMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/SecurityIdentityMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/SessionMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/TransactionMethodMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/TransactionMethodMetaDataIterator.java
projects/metadata/trunk/src/main/java/org/jboss/security/
projects/metadata/trunk/src/main/java/org/jboss/security/AnybodyPrincipal.java
projects/metadata/trunk/src/main/java/org/jboss/security/NobodyPrincipal.java
projects/metadata/trunk/src/main/java/org/jboss/security/SecurityRoleMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/security/SimplePrincipal.java
Modified:
projects/metadata/trunk/src/main/java/org/jboss/metadata/SecurityRoleRefMetaData.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeanMetaData.java
projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/AbstractEJBEverythingTest.java
projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EjbJar21EverythingUnitTestCase.java
projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EjbJar21UnitTestCase.java
projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EjbJar3xEverythingUnitTestCase.java
projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EjbJar3xUnitTestCase.java
projects/metadata/trunk/src/test/java/org/jboss/test/metadata/javaee/AbstractJavaEEEverythingTest.java
Log:
integration with the org.jboss.metadata
Added: projects/metadata/trunk/src/main/java/org/jboss/deployment/DeploymentException.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/deployment/DeploymentException.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/deployment/DeploymentException.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.deployment;
+
+
+/**
+ * A DeploymentException.
+ *
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class DeploymentException extends Exception
+{
+
+ public DeploymentException()
+ {
+ super();
+ }
+
+ public DeploymentException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public DeploymentException(String message)
+ {
+ super(message);
+ }
+
+ public DeploymentException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/invocation/InvocationType.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/invocation/InvocationType.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/invocation/InvocationType.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,90 @@
+/*
+* 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.invocation;
+
+import java.io.Serializable;
+import java.io.ObjectStreamException;
+
+/** Type safe enumeration used for to identify the invocation types.
+ *
+ * @author Scott.Stark at jboss.org
+ * @author Christoph.Jung at infor.de
+ * @version $Revision: 37390 $
+ */
+public final class InvocationType implements Serializable
+{
+ /** Serial Version Identifier. @since 1.2 */
+ private static final long serialVersionUID = 6460196085190851775L;
+ /** The method-intf names for the InvocationType enums */
+ private static final String[] INTERFACE_NAMES = { "Remote",
+ "Local", "Home", "LocalHome", "ServiceEndpoint"
+ };
+
+ /** The max ordinal value in use for the InvocationType enums. When you add a
+ * new key enum value you must assign it an ordinal value of the current
+ * MAX_TYPE_ID+1 and update the MAX_TYPE_ID value.
+ */
+ private static final int MAX_TYPE_ID = 4;
+
+ /** The array of InvocationKey indexed by ordinal value of the key */
+ private static final InvocationType[] values = new InvocationType[MAX_TYPE_ID+1];
+ public static final InvocationType REMOTE =
+ new InvocationType("REMOTE", 0);
+ public static final InvocationType LOCAL =
+ new InvocationType("LOCAL", 1);
+ public static final InvocationType HOME =
+ new InvocationType("HOME", 2);
+ public static final InvocationType LOCALHOME =
+ new InvocationType("LOCALHOME", 3);
+ public static final InvocationType SERVICE_ENDPOINT =
+ new InvocationType("SERVICE_ENDPOINT", 4);
+
+ private final transient String name;
+
+ // this is the only value serialized
+ private final int ordinal;
+
+ private InvocationType(String name, int ordinal)
+ {
+ this.name = name;
+ this.ordinal = ordinal;
+ values[ordinal] = this;
+ }
+
+ public String toString()
+ {
+ return name;
+ }
+ /** Get the method-intf name for the type
+ *
+ * @return one of: "Remote", "Local", "Home", "LocalHome", "ServiceEndpoint"
+ */
+ public String toInterfaceString()
+ {
+ return INTERFACE_NAMES[ordinal];
+ }
+
+ Object readResolve() throws ObjectStreamException
+ {
+ return values[ordinal];
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/ActivationConfigPropertyMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ActivationConfigPropertyMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/ActivationConfigPropertyMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,106 @@
+/*
+* 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 org.jboss.metadata.spi.MetaData;
+
+/**
+ * Parse the activation-config-property element used in message driven bean.
+ * It is a name/value pair
+ *
+ * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>.
+ * @version $Revision: 37459 $
+ */
+ at Deprecated
+public class ActivationConfigPropertyMetaData extends OldMetaData<org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData>
+{
+ /**
+ * Create a new ActivationConfigPropertyMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public ActivationConfigPropertyMetaData(org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new ActivationConfigPropertyMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData}
+ */
+ protected ActivationConfigPropertyMetaData(MetaData metaData)
+ {
+ super(metaData, org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData.class);
+ }
+
+ /**
+ * Retrieve the property name
+ *
+ * @return the name
+ */
+ public String getName()
+ {
+ return getDelegate().getName();
+ }
+
+ /**
+ * Set the name
+ *
+ * @param name the name
+ * @throws UnsupportedOperationException always
+ */
+ public void setName(String name)
+ {
+ throw new UnsupportedOperationException("setName");
+ }
+
+ /**
+ * Retrieve the property value
+ *
+ * @return the value
+ */
+ public String getValue()
+ {
+ return getDelegate().getValue();
+ }
+
+ /**
+ * Set the value
+ *
+ * @param value the value
+ * @throws UnsupportedOperationException always
+ */
+ public void setValue(String value)
+ {
+ throw new UnsupportedOperationException("setValue");
+ }
+
+ @Override
+ public String toString()
+ {
+ return "ActivationConfigProperty(" + getName() + "=" + getValue() + ")";
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/ApplicationMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ApplicationMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/ApplicationMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,616 @@
+/*
+ * 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 java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.jboss.metadata.ejb.jboss.ContainerConfigurationMetaData;
+import org.jboss.metadata.ejb.jboss.ContainerConfigurationsMetaData;
+import org.jboss.metadata.ejb.jboss.InvokerProxyBindingsMetaData;
+import org.jboss.metadata.ejb.jboss.JBossAssemblyDescriptorMetaData;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeansMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
+import org.jboss.metadata.ejb.jboss.ResourceManagerMetaData;
+import org.jboss.metadata.ejb.jboss.WebserviceDescriptionMetaData;
+import org.jboss.metadata.ejb.jboss.WebserviceDescriptionsMetaData;
+import org.jboss.metadata.ejb.jboss.WebservicesMetaData;
+import org.jboss.metadata.ejb.spec.EjbJarMetaData;
+import org.jboss.metadata.ejb.spec.RelationsMetaData;
+import org.jboss.metadata.spi.MetaData;
+
+/**
+ * The top level meta data from the jboss.xml and ejb-jar.xml descriptor.
+ *
+ * @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini</a>
+ * @author <a href="mailto:peter.antman at tim.se">Peter Antman</a>
+ * @author <a href="mailto:Scott.Stark at jboss.org">Scott Stark</a>
+ * @author <a href="mailto:criege at riege.com">Christian Riege</a>
+ * @author <a href="mailto:Christoph.Jung at infor.de">Christoph G. Jung</a>.
+ * @author <a href="mailto:Thomas.Diesler at jboss.org">Thomas Diesler</a>.
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 44877 $
+ */
+ at Deprecated
+public class ApplicationMetaData extends OldMetaDataWithOverride<JBossMetaData, EjbJarMetaData>
+{
+ /** EJB1.x */
+ @Deprecated
+ public static final int EJB_1x = 1;
+
+ /** EJB2.x */
+ @Deprecated
+ public static final int EJB_2x = 2;
+
+ /**
+ * Wrap the ejbJarMetaData in the jboss metadata
+ *
+ * @param delegate the delegate
+ * @return the wrapped delegate
+ */
+ private static JBossMetaData wrap(EjbJarMetaData delegate)
+ {
+ JBossMetaData jbossMetaData = new JBossMetaData();
+ jbossMetaData.setOverridenMetaData(delegate);
+ return jbossMetaData;
+ }
+
+ /**
+ * Create a new ApplicationMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public ApplicationMetaData(JBossMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new ApplicationMetaData.<p>
+ *
+ * FOR TESTING PURPOSES ONLY
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public ApplicationMetaData(EjbJarMetaData delegate)
+ {
+ this(wrap(delegate));
+ }
+
+ /**
+ * Create a new ApplicationMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link JBossMetaData}
+ */
+ protected ApplicationMetaData(MetaData metaData)
+ {
+ super(metaData, JBossMetaData.class);
+ }
+
+ /**
+ * Whether this is ejb1.x
+ *
+ * @return true when ejb1.x
+ */
+ public boolean isEJB1x()
+ {
+ return getOverridenDelegate().isEJB1x();
+ }
+
+ /**
+ * Whether this is ejb2.x
+ *
+ * @return true when ejb2.x
+ */
+ public boolean isEJB2x()
+ {
+ return getOverridenDelegate().isEJB2x();
+ }
+
+ /**
+ * Whether this is ejb2.1
+ *
+ * @return true when ejb2.1
+ */
+ public boolean isEJB21()
+ {
+ return getOverridenDelegate().isEJB21();
+ }
+
+ /**
+ * Whether this is ejb3.x
+ *
+ * @return true when ejb3.x
+ */
+ public boolean isEJB3x()
+ {
+ return getOverridenDelegate().isEJB3x();
+ }
+
+ /**
+ * Get the enterprise beans
+ *
+ * @return the enterprise beans
+ */
+ public Iterator<BeanMetaData> getEnterpriseBeans()
+ {
+ JBossEnterpriseBeansMetaData beans = getDelegate().getMergedEnterpriseBeans();
+ return new OldMetaDataIterator<JBossEnterpriseBeanMetaData, BeanMetaData>(beans, JBossEnterpriseBeanMetaData.class, BeanMetaData.class);
+ }
+
+ /**
+ * Get an EJB by its declared <ejb-name> tag
+ *
+ * @param ejbName EJB to return
+ *
+ * @return BeanMetaData pertaining to the given ejb-name, <code>null</code> if none found
+ * @throws IllegalArgumentException for a null name
+ */
+ public BeanMetaData getBeanByEjbName(String ejbName)
+ {
+ JBossEnterpriseBeansMetaData beans = getDelegate().getMergedEnterpriseBeans();
+ JBossEnterpriseBeanMetaData bean = beans.get(ejbName);
+ if (bean == null)
+ return null;
+ return BeanMetaData.create(bean);
+ }
+
+ /**
+ * Get the container managed relations in this application.
+ * Items are instance of RelationMetaData.
+ *
+ * @return the relations
+ */
+ public Iterator<RelationMetaData> getRelationships()
+ {
+ RelationsMetaData relations = getOverridenDelegate().getRelationships();
+ return new OldMetaDataIterator<org.jboss.metadata.ejb.spec.RelationMetaData, RelationMetaData>(relations, org.jboss.metadata.ejb.spec.RelationMetaData.class, RelationMetaData.class);
+ }
+
+ /**
+ * Get the assembly descriptor
+ *
+ * @return the assembly descriptor
+ */
+ public AssemblyDescriptorMetaData getAssemblyDescriptor()
+ {
+ JBossAssemblyDescriptorMetaData delegate = getDelegate().getMergedAssemblyDescriptor();
+ return new AssemblyDescriptorMetaData(delegate);
+ }
+
+ /**
+ * Get a message destination
+ *
+ * @param name destination name
+ * @return the message destination
+ */
+ public MessageDestinationMetaData getMessageDestination(String name)
+ {
+ org.jboss.metadata.ejb.spec.AssemblyDescriptorMetaData delegate = getOverridenDelegate().getAssemblyDescriptor();
+ if (delegate == null)
+ return null;
+ org.jboss.metadata.javaee.spec.MessageDestinationMetaData destination = delegate.getMessageDestination(name);
+ if (destination == null)
+ return null;
+ return new MessageDestinationMetaData(destination);
+ }
+
+ /**
+ * Get the config name
+ *
+ * @return the config name
+ */
+ public String getConfigName()
+ {
+ WebservicesMetaData webservices = getDelegate().getWebservices();
+ if (webservices == null)
+ return null;
+ WebserviceDescriptionsMetaData descriptions = webservices.getWebserviceDescriptions();
+ if (descriptions == null)
+ return null;
+ // Return the last one (regardless of whether it is null and previous ones weren't)
+ // since that is what the old broken code did (compatibility! :-)
+ String result = null;
+ for (WebserviceDescriptionMetaData description : descriptions)
+ result = description.getConfigName();
+ return result;
+ }
+
+ /**
+ * Get the config file
+ *
+ * @return the config file
+ */
+ public String getConfigFile()
+ {
+ WebservicesMetaData webservices = getDelegate().getWebservices();
+ if (webservices == null)
+ return null;
+ WebserviceDescriptionsMetaData descriptions = webservices.getWebserviceDescriptions();
+ if (descriptions == null)
+ return null;
+ // Return the last one (regardless of whether it is null and previous ones weren't)
+ // since that is what the old broken code did (compatibility! :-)
+ String result = null;
+ for (WebserviceDescriptionMetaData description : descriptions)
+ result = description.getConfigFile();
+ return result;
+ }
+
+ /**
+ * Get the Wsdl Publish locations
+ *
+ * @return the locations
+ */
+ public Map<String, String> getWsdlPublishLocations()
+ {
+ // We have to return an empty map like the old code, even when there is nothing
+ Map<String, String> result = new LinkedHashMap<String, String>();
+ WebservicesMetaData webservices = getDelegate().getWebservices();
+ if (webservices == null)
+ return result;
+ WebserviceDescriptionsMetaData descriptions = webservices.getWebserviceDescriptions();
+ if (descriptions == null)
+ return result;
+
+ // The old code didn't check for null wsdl location, so neither does this
+ for (WebserviceDescriptionMetaData description : descriptions)
+ result.put(description.getWebserviceDescriptionName(), description.getWsdlPublishLocation());
+ return result;
+ }
+
+ /**
+ * Get the wsdl publish location by name
+ *
+ * @param name the name
+ * @return the location
+ */
+ public String getWsdlPublishLocationByName(String name)
+ {
+ WebservicesMetaData webservices = getDelegate().getWebservices();
+ if (webservices == null)
+ return null;
+ WebserviceDescriptionsMetaData descriptions = webservices.getWebserviceDescriptions();
+ if (descriptions == null)
+ return null;
+ WebserviceDescriptionMetaData description = descriptions.get(name);
+ if (description == null)
+ return null;
+ return description.getWsdlPublishLocation();
+ }
+
+ /**
+ * Get the webservice context root
+ *
+ * @return the context root
+ */
+ public String getWebServiceContextRoot()
+ {
+ WebservicesMetaData webservices = getDelegate().getWebservices();
+ if (webservices == null)
+ return null;
+ return webservices.getContextRoot();
+ }
+
+ /**
+ * Get the configurations
+ *
+ * @return the configurations
+ */
+ public Iterator<ConfigurationMetaData> getConfigurations()
+ {
+ ContainerConfigurationsMetaData delegate = getDelegate().getContainerConfigurations();
+ if (delegate == null)
+ {
+ Collection<ConfigurationMetaData> result = Collections.emptyList();
+ return result.iterator();
+ }
+ return new OldMetaDataIterator<ContainerConfigurationMetaData, ConfigurationMetaData>(delegate, ContainerConfigurationMetaData.class, ConfigurationMetaData.class);
+ }
+
+ /**
+ * Get a configuration by name
+ *
+ * @param name the configuration name
+ * @return the configuration or null if not found
+ * @throws IllegalArgumentException for a null name
+ */
+ public ConfigurationMetaData getConfigurationMetaDataByName(String name)
+ {
+ ContainerConfigurationMetaData delegate = getDelegate().getContainerConfiguration(name);
+ if (delegate == null)
+ return null;
+ return new ConfigurationMetaData(delegate);
+ }
+
+ /**
+ * Get the invoker proxy bindings
+ *
+ * @return the invoker proxy bindings
+ */
+ public Iterator<InvokerProxyBindingMetaData> getInvokerProxyBindings()
+ {
+ InvokerProxyBindingsMetaData delegate = getDelegate().getInvokerProxyBindings();
+ if (delegate == null)
+ {
+ Collection<InvokerProxyBindingMetaData> result = Collections.emptyList();
+ return result.iterator();
+ }
+ return new OldMetaDataIterator<org.jboss.metadata.ejb.jboss.InvokerProxyBindingMetaData, InvokerProxyBindingMetaData>(delegate, org.jboss.metadata.ejb.jboss.InvokerProxyBindingMetaData.class, InvokerProxyBindingMetaData.class);
+ }
+
+ /**
+ * Get an invoker proxy binding by name
+ *
+ * @param name the name
+ * @return the invoker proxy binding
+ */
+ public InvokerProxyBindingMetaData getInvokerProxyBindingMetaDataByName(String name)
+ {
+ org.jboss.metadata.ejb.jboss.InvokerProxyBindingMetaData delegate = getDelegate().getInvokerProxyBinding(name);
+ if (delegate == null)
+ return null;
+ else
+ return new InvokerProxyBindingMetaData(delegate);
+ }
+
+ /**
+ * Get a resource by name
+ *
+ * @param name the name
+ * @return the resource
+ * @throws IllegalArgumentException for a null name
+ */
+ public String getResourceByName(String name)
+ {
+ ResourceManagerMetaData manager = getDelegate().getResourceManager(name);
+ if (manager == null)
+ return null;
+ return manager.getResource();
+ }
+
+ /**
+ * Get the jmx name
+ *
+ * @return the jmx name
+ */
+ public String getJmxName()
+ {
+ return getDelegate().getJmxName();
+ }
+
+ /**
+ * Get the security domain
+ *
+ * @return the security domain
+ */
+ public String getSecurityDomain()
+ {
+ return getDelegate().getSecurityDomain();
+ }
+
+ /**
+ * Get the unathenticated principal
+ *
+ * @return the unauthenticated principal
+ */
+ public String getUnauthenticatedPrincipal()
+ {
+ return getDelegate().getUnauthenticatedPrincipal();
+ }
+
+ /**
+ * Get whether to exclude missing methods
+ *
+ * @return true when exclude missing methods
+ */
+ public boolean isExcludeMissingMethods()
+ {
+ return getDelegate().isExcludeMissingMethods();
+ }
+
+ /**
+ * Whether to throw an exception on rollback
+ *
+ * @return true when throwing an exception on rollback
+ */
+ public boolean getExceptionRollback()
+ {
+ return getDelegate().isExceptionOnRollback();
+ }
+
+ /**
+ * Get the enforce ejb restrictions
+ *
+ * @return whether to enforce ejb restrictions
+ * @throws UnsupportedOperationException always
+ */
+ public boolean getEnforceEjbRestrictions()
+ {
+ throw new UnsupportedOperationException("getEnforceEjbRestrictions");
+ }
+
+ /**
+ * Add bean metadata
+ *
+ * @param metaData the bean metadata
+ * @throws UnsupportedOperationException always
+ */
+ public void addBeanMetaData(BeanMetaData metaData)
+ {
+ throw new UnsupportedOperationException("addBeanMetaData");
+ }
+
+ /**
+ * Get the ClassLoader to load additional resources
+ *
+ * @return the classloader used to load resources
+ * @throws UnsupportedOperationException always
+ */
+ public URLClassLoader getResourceCl()
+ {
+ throw new UnsupportedOperationException("getResourceCL");
+ }
+
+ /**
+ * Set the ClassLoader to load additional resources
+ *
+ * @param resourceCl the resource classloader
+ * @throws UnsupportedOperationException always
+ */
+ public void setResourceClassLoader(URLClassLoader resourceCl)
+ {
+ throw new UnsupportedOperationException("setResourceCL");
+ }
+
+ /**
+ * Get the url
+ *
+ * @return the url
+ * @throws UnsupportedOperationException always
+ */
+ public URL getUrl()
+ {
+ throw new UnsupportedOperationException("getUrl");
+ }
+
+ /**
+ * Set the url
+ *
+ * @param u the url
+ * @throws UnsupportedOperationException always
+ */
+ public void setUrl(URL u)
+ {
+ throw new UnsupportedOperationException("setUrl");
+ }
+
+ /**
+ * Set the config file
+ *
+ * @param configFile the config file
+ * @throws UnsupportedOperationException always
+ */
+ public void setConfigFile(String configFile)
+ {
+ throw new UnsupportedOperationException("setConfigFile");
+ }
+
+ /**
+ * Set the config name
+ *
+ * @param configName the config name
+ * @throws UnsupportedOperationException always
+ */
+ public void setConfigName(String configName)
+ {
+ throw new UnsupportedOperationException("setConfigName");
+ }
+
+ /**
+ * Add plugin data
+ *
+ * @param pluginName the plugin name
+ * @param pluginData the plugin data
+ * @throws UnsupportedOperationException always
+ */
+ public void addPluginData(String pluginName, Object pluginData)
+ {
+ throw new UnsupportedOperationException("addPluginData");
+ }
+
+ /**
+ * Get plugin data
+ *
+ * @param pluginName the plugin name
+ * @return the plugin data
+ * @throws UnsupportedOperationException always
+ */
+ public Object getPluginData(String pluginName)
+ {
+ throw new UnsupportedOperationException("getPluginData");
+ }
+
+ /**
+ * Set the security domain for this web application
+ *
+ * @param securityDomain the security domain
+ * @throws UnsupportedOperationException always
+ */
+ public void setSecurityDomain(String securityDomain)
+ {
+ throw new UnsupportedOperationException("setSecurityDomain");
+ }
+
+ /**
+ * Set the unathenticated principal
+ *
+ * @param unauthenticatedPrincipal the unathenticated principal
+ * @throws UnsupportedOperationException always
+ */
+ public void setUnauthenticatedPrincipal(String unauthenticatedPrincipal)
+ {
+ throw new UnsupportedOperationException("setUnathenticatedPrincipal");
+ }
+
+ /**
+ * Get whether this is a webservice deployment
+ *
+ * @return true when a webservice deployment
+ */
+ public boolean isWebServiceDeployment()
+ {
+ throw new UnsupportedOperationException("isWebServiceDeployment");
+ }
+
+ /**
+ * Set whether this is a webservice deployment
+ *
+ * @param webServiceDeployment true when a webservice deployment
+ * @throws UnsupportedOperationException always
+ */
+ public void setWebServiceDeployment(boolean webServiceDeployment)
+ {
+ throw new UnsupportedOperationException("setWebServiceDeployment");
+ }
+
+ /**
+ * Set the webservice context root
+ *
+ * @param webServiceContextRoot the context root
+ * @throws UnsupportedOperationException always
+ */
+ public void setWebServiceContextRoot(String webServiceContextRoot)
+ {
+ throw new UnsupportedOperationException("setWebServiceContextRoot");
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/AssemblyDescriptorMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/AssemblyDescriptorMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/AssemblyDescriptorMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,158 @@
+/*
+* 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 java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.metadata.ejb.jboss.JBossAssemblyDescriptorMetaData;
+import org.jboss.metadata.javaee.spec.SecurityRolesMetaData;
+import org.jboss.metadata.spi.MetaData;
+import org.jboss.security.SecurityRoleMetaData;
+
+/**
+ * The meta data object for the assembly-descriptor element.
+ * This implementation only contains the security-role meta data
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 40750 $
+ */
+ at Deprecated
+public class AssemblyDescriptorMetaData extends OldMetaDataWithOverride<JBossAssemblyDescriptorMetaData, org.jboss.metadata.ejb.spec.AssemblyDescriptorMetaData>
+{
+ /**
+ * Create a new AssemblyDescriptorMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public AssemblyDescriptorMetaData(JBossAssemblyDescriptorMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new AssemblyDescriptorMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link JBossAssemblyDescriptorMetaData}
+ */
+ protected AssemblyDescriptorMetaData(MetaData metaData)
+ {
+ super(metaData, JBossAssemblyDescriptorMetaData.class);
+ }
+
+ /**
+ * Get the security roles
+ *
+ * @return the security roles
+ */
+ public Map<String, SecurityRoleMetaData> getSecurityRoles()
+ {
+ SecurityRolesMetaData roles = getDelegate().getSecurityRoles();
+ if (roles == null)
+ return Collections.emptyMap();
+ Map<String, SecurityRoleMetaData> result = new LinkedHashMap<String, SecurityRoleMetaData>(roles.size());
+ for (org.jboss.metadata.javaee.spec.SecurityRoleMetaData role : roles)
+ result.put(role.getRoleName(), new SecurityRoleMetaData(role));
+ return result;
+ }
+
+ /**
+ * Get a security role by role name
+ *
+ * @param roleName the role name
+ * @return the role
+ */
+ public SecurityRoleMetaData getSecurityRoleByName(String roleName)
+ {
+ org.jboss.metadata.javaee.spec.SecurityRoleMetaData role = getDelegate().getSecurityRole(roleName);
+ if (role == null)
+ return null;
+ return new SecurityRoleMetaData(role);
+ }
+
+ /**
+ * Get the security role names by principal
+ *
+ * @param userName the user name
+ * @return the role name
+ * @throws IllegalArgumentException for a null role name
+ */
+ public Set<String> getSecurityRoleNamesByPrincipal(String userName)
+ {
+ return getDelegate().getSecurityRoleNamesByPrincipal(userName);
+ }
+
+ /**
+ * Get a message destination by name
+ *
+ * @param name the name
+ * @return the destination
+ * @throws IllegalArgumentException for a null name
+ */
+ public MessageDestinationMetaData getMessageDestinationMetaData(String name)
+ {
+ org.jboss.metadata.javaee.spec.MessageDestinationMetaData destination = getDelegate().getMessageDestination(name);
+ if (destination == null)
+ return null;
+ return new MessageDestinationMetaData(destination);
+ }
+
+ /**
+ * Add security role metadata
+ *
+ * @param srMetaData the security role metadata
+ * @throws UnsupportedOperationException always
+ */
+ public void addSecurityRoleMetaData(SecurityRoleMetaData srMetaData)
+ {
+ throw new UnsupportedOperationException("addSecurityRoleMetaData");
+ }
+
+ /**
+ * Merge the security role/principal mapping defined in jboss.xml
+ * with the one defined at jboss-app.xml.
+ *
+ * @param applRoles the application roles
+ * @throws UnsupportedOperationException always
+ */
+ public void mergeSecurityRoles(Map applRoles)
+ {
+ throw new UnsupportedOperationException("mergeSecurityRoles");
+ }
+
+ /**
+ * Add a message destination
+ *
+ * @param metaData the message destination
+ * @throws UnsupportedOperationException always
+ */
+ public void addMessageDestinationMetaData(MessageDestinationMetaData metaData)
+ {
+ throw new UnsupportedOperationException("addMessageDestinationMetaData");
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/BeanMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/BeanMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/BeanMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,792 @@
+/*
+* 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 java.lang.reflect.Method;
+import java.security.Principal;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.jboss.metadata.ejb.jboss.ContainerConfigurationMetaData;
+import org.jboss.metadata.ejb.jboss.IORSecurityConfigMetaData;
+import org.jboss.metadata.ejb.jboss.InvokerBindingMetaData;
+import org.jboss.metadata.ejb.jboss.InvokerBindingsMetaData;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.spec.ContainerTransactionsMetaData;
+import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.spec.ExcludeListMetaData;
+import org.jboss.metadata.ejb.spec.MethodInterfaceType;
+import org.jboss.metadata.ejb.spec.MethodPermissionsMetaData;
+import org.jboss.metadata.ejb.spec.TransAttributeType;
+import org.jboss.invocation.InvocationType;
+import org.jboss.metadata.javaee.spec.EJBLocalReferenceMetaData;
+import org.jboss.metadata.javaee.spec.EJBLocalReferencesMetaData;
+import org.jboss.metadata.javaee.spec.EJBReferenceMetaData;
+import org.jboss.metadata.javaee.spec.EJBReferencesMetaData;
+import org.jboss.metadata.javaee.spec.EnvironmentEntriesMetaData;
+import org.jboss.metadata.javaee.spec.EnvironmentEntryMetaData;
+import org.jboss.metadata.javaee.spec.MessageDestinationReferenceMetaData;
+import org.jboss.metadata.javaee.spec.MessageDestinationReferencesMetaData;
+import org.jboss.metadata.javaee.spec.ResourceEnvironmentReferenceMetaData;
+import org.jboss.metadata.javaee.spec.ResourceEnvironmentReferencesMetaData;
+import org.jboss.metadata.javaee.spec.ResourceReferenceMetaData;
+import org.jboss.metadata.javaee.spec.ResourceReferencesMetaData;
+import org.jboss.metadata.spi.MetaData;
+
+/**
+ * A common meta data class for the entity, message-driven and session beans.
+ *
+ * @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini</a>
+ * @author <a href="mailto:peter.antman at tim.se">Peter Antman</a>
+ * @author <a href="mailto:docodan at mvcsoft.com">Daniel OConnor</a>
+ * @author <a href="mailto:Scott.Stark at jboss.org">Scott Stark</a>
+ * @author <a href="mailto:osh at sparre.dk">Ole Husgaard</a>
+ * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
+ * @author <a href="mailto:criege at riege.com">Christian Riege</a>
+ * @author <a href="mailto:Thomas.Diesler at jboss.org">Thomas Diesler</a>
+ * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 45953 $
+ */
+ at Deprecated
+public abstract class BeanMetaData extends OldMetaDataWithOverride<JBossEnterpriseBeanMetaData, EnterpriseBeanMetaData>
+{
+ /** Session type */
+ public static final char SESSION_TYPE = 'S';
+
+ /** Entity type */
+ public static final char ENTITY_TYPE = 'E';
+
+ /** MDB type */
+ public static final char MDB_TYPE = 'M';
+
+ /** The local invoker proxy binding name */
+ public static final String LOCAL_INVOKER_PROXY_BINDING = "LOCAL";
+
+ /** The transaction type cache */
+ private ConcurrentHashMap<Method, Byte> methodTx = new ConcurrentHashMap<Method, Byte>();
+
+ /**
+ * Create a new BeanMetaData.
+ *
+ * @param delegate the delegate
+ * @return the metadata
+ * @throws IllegalArgumentException for a null delegate or an unknown delegate
+ */
+ public static BeanMetaData create(JBossEnterpriseBeanMetaData delegate)
+ {
+ if (delegate == null)
+ throw new IllegalArgumentException("Null delegate");
+ if (delegate.isSession())
+ return new SessionMetaData(delegate);
+ if (delegate.isMessageDriven())
+ return new MessageDrivenMetaData(delegate);
+ if (delegate.isEntity())
+ return new EntityMetaData(delegate);
+ throw new IllegalArgumentException("Unknown delegate: " + delegate);
+ }
+
+ /**
+ * Create a new BeanMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ protected BeanMetaData(JBossEnterpriseBeanMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new BeanMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link JBossEnterpriseBeanMetaData}
+ */
+ protected BeanMetaData(MetaData metaData)
+ {
+ super(metaData, JBossEnterpriseBeanMetaData.class);
+ }
+
+ /**
+ * Whether this is a session bean
+ *
+ * @return true when a session bean
+ */
+ public boolean isSession()
+ {
+ return getDelegate().isSession();
+ }
+
+ /**
+ * Whether this is a message driven bean
+ *
+ * @return true when a message driven bean
+ */
+ public boolean isMessageDriven()
+ {
+ return getDelegate().isMessageDriven();
+ }
+
+ /**
+ * Whether this is an entity bean
+ *
+ * @return true when an entity bean
+ */
+ public boolean isEntity()
+ {
+ return getDelegate().isEntity();
+ }
+
+ /**
+ * Get the ejb name
+ *
+ * @return the ejb name
+ */
+ public String getEjbName()
+ {
+ return getDelegate().getEjbName();
+ }
+
+ /**
+ * Get the home class name
+ *
+ * @return the home class name
+ */
+ public abstract String getHome();
+
+ /**
+ * Get the remote class name
+ *
+ * @return the remote class name
+ */
+ public abstract String getRemote();
+
+ /**
+ * Get the local home class name
+ *
+ * @return the local home class name
+ */
+ public abstract String getLocalHome();
+
+ /**
+ * Get the local class name
+ *
+ * @return the local class name
+ */
+ public abstract String getLocal();
+
+ /**
+ * Get the service endpoint
+ *
+ * @return the service endpoint
+ */
+ public abstract String getServiceEndpoint();
+
+ /**
+ * Get the ejbClass.
+ *
+ * @return the ejbClass.
+ */
+ public String getEjbClass()
+ {
+ return getOverridenDelegate().getEjbClass();
+ }
+
+ /**
+ * Get the container managed transactions
+ *
+ * @return the container managed transactions
+ */
+ public boolean isContainerManagedTx()
+ {
+ return getOverridenDelegate().isCMT();
+ }
+
+ /**
+ * Is bean managed transaction
+ *
+ * @return true for BMT
+ */
+ public boolean isBeanManagedTx()
+ {
+ return getOverridenDelegate().isBMT();
+ }
+
+ /**
+ * Get the ejb references
+ *
+ * @return the ejb references
+ */
+ public Iterator<EjbRefMetaData> getEjbReferences()
+ {
+ EJBReferencesMetaData ejbRefs = getDelegate().getEjbReferences();
+ return new OldMetaDataIterator<EJBReferenceMetaData, EjbRefMetaData>(ejbRefs, EJBReferenceMetaData.class, EjbRefMetaData.class);
+ }
+
+ /**
+ * Get the ejb local references
+ *
+ * @return the local references
+ */
+ public Iterator<EjbLocalRefMetaData> getEjbLocalReferences()
+ {
+ EJBLocalReferencesMetaData ejbLocalRefs = getDelegate().getEjbLocalReferences();
+ return new OldMetaDataIterator<EJBLocalReferenceMetaData, EjbLocalRefMetaData>(ejbLocalRefs, EJBLocalReferenceMetaData.class, EjbLocalRefMetaData.class);
+ }
+
+ /**
+ * Get an ejb reference by name
+ *
+ * @param name the name
+ * @return the reference or null if not found
+ * @throws IllegalArgumentException for a null name
+ */
+ public EjbRefMetaData getEjbRefByName(String name)
+ {
+ EJBReferenceMetaData result = getDelegate().getEjbReferenceByName(name);
+ if (result != null)
+ return new EjbRefMetaData(result);
+ return null;
+ }
+
+ /**
+ * Get an ejb local reference by name
+ *
+ * @param name the name
+ * @return the reference or null if not found
+ * @throws IllegalArgumentException for a null name
+ */
+ public EjbLocalRefMetaData getEjbLocalRefByName(String name)
+ {
+ EJBLocalReferenceMetaData result = getDelegate().getEjbLocalReferenceByName(name);
+ if (result != null)
+ return new EjbLocalRefMetaData(result);
+ return null;
+ }
+
+ /**
+ * Get the environment entries
+ *
+ * @return the environment entries
+ */
+ public Iterator<EnvEntryMetaData> getEnvironmentEntries()
+ {
+ EnvironmentEntriesMetaData result = getDelegate().getEnvironmentEntries();
+ return new OldMetaDataIterator<EnvironmentEntryMetaData, EnvEntryMetaData>(result, EnvironmentEntryMetaData.class, EnvEntryMetaData.class);
+ }
+
+ /**
+ * Get the security role references
+ *
+ * @return the security role references
+ */
+ public abstract Iterator<SecurityRoleRefMetaData> getSecurityRoleReferences();
+
+ /**
+ * Get the resource references
+ *
+ * @return the resource references
+ */
+ public Iterator<ResourceRefMetaData> getResourceReferences()
+ {
+ ResourceReferencesMetaData result = getDelegate().getResourceReferences();
+ return new OldMetaDataIterator<ResourceReferenceMetaData, ResourceRefMetaData>(result, ResourceReferenceMetaData.class, ResourceRefMetaData.class);
+ }
+
+ /**
+ * Get the resource environment references
+ *
+ * @return the resource environment references
+ */
+ public Iterator<ResourceEnvRefMetaData> getResourceEnvReferences()
+ {
+ ResourceEnvironmentReferencesMetaData result = getDelegate().getResourceEnvironmentReferences();
+ return new OldMetaDataIterator<ResourceEnvironmentReferenceMetaData, ResourceEnvRefMetaData>(result, ResourceEnvironmentReferenceMetaData.class, ResourceEnvRefMetaData.class);
+ }
+
+ /**
+ * Get the message destination references
+ *
+ * @return the message destination references
+ */
+ public Iterator<MessageDestinationRefMetaData> getMessageDestinationReferences()
+ {
+ MessageDestinationReferencesMetaData result = getDelegate().getMessageDestinationReferences();
+ return new OldMetaDataIterator<MessageDestinationReferenceMetaData, MessageDestinationRefMetaData>(result, MessageDestinationReferenceMetaData.class, MessageDestinationRefMetaData.class);
+ }
+
+ /**
+ * @return HashMap<ServiceRefMetaData>
+ */
+ /* TODO webservice service refs
+ public HashMap getServiceReferences()
+ {
+ return serviceReferences;
+ }
+ */
+
+ /**
+ * Get the security identity
+ *
+ * @return the security identity or null if none is specified
+ */
+ public SecurityIdentityMetaData getSecurityIdentityMetaData()
+ {
+ org.jboss.metadata.ejb.spec.SecurityIdentityMetaData securityIdentity = getDelegate().getSecurityIdentity();
+ if (securityIdentity != null)
+ return new SecurityIdentityMetaData(securityIdentity);
+ return null;
+ }
+
+ /**
+ * Get the transaction methods
+ *
+ * @return the transaction methods
+ */
+ public Iterator<MethodMetaData> getTransactionMethods()
+ {
+ ContainerTransactionsMetaData transactions = getOverridenDelegate().getContainerTransactions();
+ return new TransactionMethodMetaDataIterator(transactions);
+ }
+
+ /**
+ * Get the method transaction type
+ *
+ * @param methodName the method name
+ * @param params the parameters
+ * @param iface the interface type
+ * @return the method transaction type
+ */
+ public byte getMethodTransactionType(String methodName, Class[] params, InvocationType iface)
+ {
+ TransAttributeType type = getOverridenDelegate().getMethodTransactionType(methodName, params, invocationTypeToMethodInterfaceType(iface));
+ return mapTransactionType(type);
+ }
+
+ /**
+ * Get the transaction type
+ *
+ * @param m the method
+ * @param iface the interface type
+ * @return the transaction type
+ */
+ public byte getTransactionMethod(Method m, InvocationType iface)
+ {
+ if (m == null)
+ return TX_SUPPORTS;
+
+ Byte b = methodTx.get(m);
+ if (b != null)
+ return b;
+
+ TransAttributeType type = getOverridenDelegate().getMethodTransactionType(m, invocationTypeToMethodInterfaceType(iface));
+ byte result = mapTransactionType(type);
+
+ // provide default if method is not found in descriptor
+ if (result == TX_UNKNOWN)
+ result = TX_REQUIRED;
+
+ methodTx.put(m, b);
+ return result;
+ }
+
+ /**
+ * Get the permission methods
+ *
+ * @return the permission methods
+ */
+ public Iterator<MethodMetaData> getPermissionMethods()
+ {
+ MethodPermissionsMetaData methodPermissions = getOverridenDelegate().getMethodPermissions();
+ return new PermissionMethodMetaDataIterator(methodPermissions);
+ }
+
+ /**
+ * Get the excluded methods
+ *
+ * @return the excluded methods
+ */
+ public Iterator<MethodMetaData> getExcludedMethods()
+ {
+ ExcludeListMetaData excluded = getOverridenDelegate().getExcludeList();
+ return new ExcludedMethodMetaDataIterator(excluded);
+ }
+
+ /**
+ * A somewhat tedious method that builds a Set<Principal> of the roles
+ * that have been assigned permission to execute the indicated method. The
+ * work performed is tedious because of the wildcard style of declaring
+ * method permission allowed in the ejb-jar.xml descriptor. This method is
+ * called by the Container.getMethodPermissions() when it fails to find the
+ * prebuilt set of method roles in its cache.
+ *
+ * @param methodName the method name
+ * @param params the parameters
+ * @param iface the interface
+ * @return The Set<Principal> for the application domain roles that
+ * caller principal's are to be validated against.
+ */
+ public Set<Principal> getMethodPermissions(String methodName, Class[] params, InvocationType iface)
+ {
+ return getDelegate().getMethodPermissions(methodName, params, invocationTypeToMethodInterfaceType(iface));
+ }
+
+ /**
+ * Check to see if there was a method-permission or exclude-list statement
+ * for the given method.
+ *
+ * @param methodName - the method name
+ * @param params - the method parameter signature
+ * @param iface - the method interface type
+ * @return true if a matching method permission exists, false if no match
+ */
+ public boolean hasMethodPermission(String methodName, Class[] params, InvocationType iface)
+ {
+ return getDelegate().hasMethodPermissions(methodName, params, invocationTypeToMethodInterfaceType(iface));
+ }
+
+ /**
+ * Get the excludeMissingMethods.
+ *
+ * @return the excludeMissingMethods.
+ */
+ public boolean isExcludeMissingMethods()
+ {
+ return getDelegate().getJBossMetaDataWithCheck().isExcludeMissingMethods();
+ }
+
+ /**
+ * Get the application metadata
+ *
+ * @return the application metadata
+ */
+ public ApplicationMetaData getApplicationMetaData()
+ {
+ return new ApplicationMetaData(getDelegate().getJBossMetaDataWithCheck());
+ }
+
+ /**
+ * Get the invoker bindings
+ *
+ * @return an iterator of invoker proxy binding names
+ */
+ public Iterator<String> getInvokerBindings()
+ {
+ InvokerBindingsMetaData invokerBindings = getDelegate().determineInvokerBindings();
+ return new InvokerBindingsIterator(invokerBindings);
+ }
+
+ /**
+ * Get an invoker binding
+ *
+ * @param invokerName the invoker proxy binding name
+ * @return the jndi name
+ */
+ public String getInvokerBinding(String invokerName)
+ {
+ InvokerBindingMetaData binding = getDelegate().determineInvokerBinding(invokerName);
+ return binding.getJndiName();
+ }
+
+ /**
+ * Get the jndi name
+ *
+ * @return the jndi name
+ */
+ public abstract String getJndiName();
+
+ /**
+ * Gets the JNDI name under with the local home interface should be bound.
+ * The default is local/<ejbName>
+ *
+ * @return the local jndi name
+ */
+ public String getLocalJndiName()
+ {
+ return getDelegate().determineLocalJndiName();
+ }
+
+ /**
+ * Gets the container jndi name used in the object name
+ *
+ * @return the jndi name suitable for use as the jndi name
+ */
+ public String getContainerObjectNameJndiName()
+ {
+ return getHome() != null ? getJndiName() : getLocalJndiName();
+ }
+
+ /**
+ * Get the configuration name
+ *
+ * @return the configuration name
+ */
+ public String getConfigurationName()
+ {
+ return getDelegate().determineConfigurationName();
+ }
+
+ /**
+ * Get the container configuration
+ *
+ * @return the configuration
+ * @throws IllegalStateException when the configuration could not be determined
+ */
+ public ConfigurationMetaData getContainerConfiguration()
+ {
+ ContainerConfigurationMetaData containerConfigurationMetaData = getDelegate().determineContainerConfiguration();
+ return new ConfigurationMetaData(containerConfigurationMetaData);
+ }
+
+ /**
+ * Get the security proxy
+ *
+ * @return the security proxy
+ */
+ public String getSecurityProxy()
+ {
+ return getDelegate().getSecurityProxy();
+ }
+
+ /**
+ * Get the ejb timeout identity
+ *
+ * @return the ejb timeout identity
+ */
+ public abstract SecurityIdentityMetaData getEjbTimeoutIdentity();
+
+ /**
+ * Get the default configuration name
+ *
+ * @return the default configuration name
+ */
+ public String getDefaultConfigurationName()
+ {
+ return getDelegate().getDefaultConfigurationName();
+ }
+
+ /**
+ * Get all the dependencies
+ *
+ * @return all the dependencies
+ */
+ public Collection<String> getDepends()
+ {
+ return getDelegate().determineAllDepends();
+ }
+
+ /**
+ * Is this method a read-only method described in jboss.xml?
+ *
+ * @param methodName the method name
+ * @return true for read only
+ */
+ public boolean isMethodReadOnly(String methodName)
+ {
+ return getDelegate().isMethodReadOnly(methodName);
+ }
+
+ /**
+ * Is this method a read-only method described in jboss.xml?
+ *
+ * @param method the method
+ * @return true for read only
+ */
+ public boolean isMethodReadOnly(Method method)
+ {
+ return getDelegate().isMethodReadOnly(method);
+ }
+
+ /**
+ * Get the transaction timeout for the method
+ *
+ * @param methodName the method name
+ * @return the transaction timeout
+ */
+ public int getTransactionTimeout(String methodName)
+ {
+ return getDelegate().getMethodTransactionTimeout(methodName);
+ }
+
+ /**
+ * Get the transaction timeout for the method
+ *
+ * @param method the method
+ * @return the transaction timeout
+ */
+ public int getTransactionTimeout(Method method)
+ {
+ return getDelegate().getMethodTransactionTimeout(method);
+ }
+
+ /**
+ * Get whether it is clustered.
+ *
+ * @return true if clustered.
+ */
+ public abstract boolean isClustered();
+
+ /**
+ * Get the callByValue.
+ *
+ * @return the callByValue.
+ */
+ public abstract boolean isCallByValue();
+
+ /**
+ * Get the cluster config
+ *
+ * @return the cluster config
+ */
+ public abstract ClusterConfigMetaData getClusterConfigMetaData();
+
+ /**
+ * Get the IOR Security config metadata
+ *
+ * @return the metadata
+ */
+ public IorSecurityConfigMetaData getIorSecurityConfigMetaData()
+ {
+ IORSecurityConfigMetaData config = getDelegate().getIorSecurityConfig();
+ if (config == null)
+ return null;
+ return new IorSecurityConfigMetaData(config);
+ }
+
+ /**
+ * Get the exceptionRollback.
+ *
+ * @return the exceptionRollback.
+ */
+ public boolean getExceptionRollback()
+ {
+ return getDelegate().isExceptionOnRollback();
+ }
+
+ /**
+ * Get the timerPersistence.
+ *
+ * @return the timerPersistence.
+ */
+ public boolean getTimerPersistence()
+ {
+ return getDelegate().isTimerPersistence();
+ }
+
+ /**
+ * Get the port component
+ *
+ * @return the port component
+ * TODO webservice PortComponent
+ public EjbPortComponentMetaData getPortComponent()
+ {
+ return portComponent;
+ }
+ */
+
+ /**
+ * Get the method interface
+ *
+ * @param type the invocation type
+ * @return the method interface
+ */
+ static MethodInterfaceType invocationTypeToMethodInterfaceType(InvocationType type)
+ {
+ if (type == null)
+ return null;
+ if (type == InvocationType.REMOTE)
+ return MethodInterfaceType.Remote;
+ if (type == InvocationType.LOCAL)
+ return MethodInterfaceType.Local;
+ if (type == InvocationType.HOME)
+ return MethodInterfaceType.Home;
+ if (type == InvocationType.LOCALHOME)
+ return MethodInterfaceType.LocalHome;
+ if (type == InvocationType.SERVICE_ENDPOINT)
+ return MethodInterfaceType.ServiceEndpoint;
+ throw new IllegalArgumentException("Unexpected invocation type: " + type);
+ }
+
+ /**
+ * Get the transaction type byte
+ *
+ * @param type the transaction type
+ * @return the byte
+ */
+ static byte mapTransactionType(TransAttributeType type)
+ {
+ if (type == null)
+ return TX_UNKNOWN;
+ switch (type)
+ {
+ case NotSupported:
+ return TX_NOT_SUPPORTED;
+ case Supports:
+ return TX_SUPPORTS;
+ case RequiresNew:
+ return TX_REQUIRES_NEW;
+ case Mandatory:
+ return TX_MANDATORY;
+ case Never:
+ return TX_NEVER;
+ default:
+ return TX_REQUIRED;
+ }
+ }
+
+ /**
+ * Add a permission method
+ *
+ * @param method the method
+ * @throws UnsupportedOperationException always
+ */
+ public void addPermissionMethod(MethodMetaData method)
+ {
+ throw new UnsupportedOperationException("addPermissionMethod");
+ }
+
+ /**
+ * Add an excluded method
+ *
+ * @param method the method
+ * @throws UnsupportedOperationException always
+ */
+ public void addExcludedMethod(MethodMetaData method)
+ {
+ throw new UnsupportedOperationException("addExcludedMethod");
+ }
+
+ /**
+ * Add a transaction method
+ *
+ * @param method the method
+ * @throws UnsupportedOperationException always
+ */
+ public void addTransactionMethod(MethodMetaData method)
+ {
+ throw new UnsupportedOperationException("addTransactionMethod");
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/CMPFieldIterator.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/CMPFieldIterator.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/CMPFieldIterator.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,75 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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 java.util.Iterator;
+import java.util.NoSuchElementException;
+
+import org.jboss.metadata.ejb.spec.CMPFieldMetaData;
+import org.jboss.metadata.ejb.spec.CMPFieldsMetaData;
+
+/**
+ * CMPFieldIterator.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Deprecated
+class CMPFieldIterator implements Iterator<String>
+{
+ /** The delegate */
+ private Iterator<CMPFieldMetaData> delegate;
+
+ /**
+ * Create a new CMPField iterator
+ *
+ * @param fields the fields
+ */
+ public CMPFieldIterator(CMPFieldsMetaData fields)
+ {
+ if (fields == null)
+ return;
+ delegate = fields.iterator();
+ }
+
+ public boolean hasNext()
+ {
+ if (delegate == null)
+ return false;
+ return delegate.hasNext();
+ }
+
+ @SuppressWarnings("unchecked")
+ public String next()
+ {
+ if (delegate == null)
+ throw new NoSuchElementException("No next");
+
+ CMPFieldMetaData next = delegate.next();
+ return next.getFieldName();
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException("remove");
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/CacheInvalidationConfigMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/CacheInvalidationConfigMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/CacheInvalidationConfigMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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 org.jboss.metadata.spi.MetaData;
+
+/**
+ * Manages attributes related to distributed (possibly local-only)
+ * cache invalidations
+ *
+ * @author <a href="mailto:sacha.labourey at cogito-info.ch">Sacha Labourey</a>.
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 57209 $
+ */
+public class CacheInvalidationConfigMetaData extends OldMetaData<org.jboss.metadata.ejb.jboss.CacheInvalidationConfigMetaData>
+{
+ /**
+ * Create a new CacheInvalidationConfigMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public CacheInvalidationConfigMetaData(org.jboss.metadata.ejb.jboss.CacheInvalidationConfigMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new CacheInvalidationConfigMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link org.jboss.metadata.ejb.jboss.CacheInvalidationConfigMetaData}
+ */
+ protected CacheInvalidationConfigMetaData(MetaData metaData)
+ {
+ super(metaData, org.jboss.metadata.ejb.jboss.CacheInvalidationConfigMetaData.class);
+ }
+
+ /**
+ * Get the invalidation group name
+ *
+ * @return the invalidation group name
+ */
+ public String getInvalidationGroupName()
+ {
+ return getDelegate().determineInvalidationGroupName();
+ }
+
+ /**
+ * Get the invalidation manager name
+ *
+ * @return the invalidation manager name
+ */
+ public String getInvalidationManagerName()
+ {
+ return getDelegate().determineInvalidationManagerName();
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/ClusterConfigMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ClusterConfigMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/ClusterConfigMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,103 @@
+/*
+* 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 org.jboss.metadata.spi.MetaData;
+
+/**
+ * The meta data object for the cluster-config element.
+ * This element only defines the HAPartition name at this time. It will be
+ * expanded to include other cluster configuration parameters later on.
+ *
+ * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>.
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 37390 $
+ */
+ at Deprecated
+public class ClusterConfigMetaData extends OldMetaData<org.jboss.metadata.ejb.jboss.ClusterConfigMetaData>
+{
+ public final static String JNDI_PREFIX_FOR_SESSION_STATE = "/HASessionState/";
+ public final static String DEFAULT_SESSION_STATE_NAME = JNDI_PREFIX_FOR_SESSION_STATE + "Default";
+
+ /**
+ * Create a new ClusterConfigMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public ClusterConfigMetaData(org.jboss.metadata.ejb.jboss.ClusterConfigMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new ClusterConfigMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link org.jboss.metadata.ejb.jboss.ClusterConfigMetaData}
+ */
+ protected ClusterConfigMetaData(MetaData metaData)
+ {
+ super(metaData, org.jboss.metadata.ejb.jboss.ClusterConfigMetaData.class);
+ }
+
+ /**
+ * Get the partition name
+ *
+ * @return the partition name
+ */
+ public String getPartitionName()
+ {
+ return getDelegate().determinePartitionName();
+ }
+
+ /**
+ * Get the home load balancing policy
+ *
+ * @return the home load balancing policy
+ */
+ public String getHomeLoadBalancePolicy()
+ {
+ return getDelegate().determineHomeLoadBalancingPolicy();
+ }
+
+ /**
+ * Get the bean load balancing policy
+ *
+ * @return the bean load balancing policy
+ */
+ public String getBeanLoadBalancePolicy()
+ {
+ return getDelegate().determineBeanLoadBalancingPolicy();
+ }
+
+ /**
+ * Get the ha session state name
+ *
+ * @return the ha session state name
+ */
+ public String getHaSessionStateName()
+ {
+ return getDelegate().determineSessionStateManagerJndiName();
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/ConfigurationMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ConfigurationMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/ConfigurationMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,344 @@
+/*
+* 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 java.util.Collection;
+import java.util.Collections;
+
+import org.jboss.metadata.ejb.jboss.CommitOption;
+import org.jboss.metadata.ejb.jboss.ContainerConfigurationMetaData;
+import org.jboss.metadata.spi.MetaData;
+
+/**
+ * The configuration information for an EJB container.
+ * @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini</a>
+ * @author <a href="mailto:scott.stark at jboss.org">Scott Stark</a>
+ * @author <a href="mailto:christoph.jung at infor.de">Christoph G. Jung</a>
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 44055 $
+ */
+ at Deprecated
+public class ConfigurationMetaData extends OldMetaData<ContainerConfigurationMetaData>
+{
+ /** The standard CMP2 configuration */
+ public static final String CMP_2x_13 = "Standard CMP 2.x EntityBean";
+
+ /** The standard CMP1.1 configuration */
+ public static final String CMP_1x_13 = "Standard CMP EntityBean";
+
+ /** The standard BMP configuration */
+ public static final String BMP_13 = "Standard BMP EntityBean";
+
+ /** The standard Stateless session configuration */
+ public static final String STATELESS_13 = "Standard Stateless SessionBean";
+
+ /** The standard Stateful session configuration */
+ public static final String STATEFUL_13 = "Standard Stateful SessionBean";
+
+ /** The message driven bean configuration */
+ public static final String MESSAGE_DRIVEN_13 = "Standard Message Driven Bean";
+
+ /** The message inflow driven bean configuration */
+ public static final String MESSAGE_INFLOW_DRIVEN_13 = "Standard Message Inflow Driven Bean";
+
+ /** The clustered CMP2 configuration */
+ public static final String CLUSTERED_CMP_2x_13 = "Clustered CMP 2.x EntityBean";
+
+ /** The clustered CMP1.1 configuration */
+ public static final String CLUSTERED_CMP_1x_13 = "Clustered CMP EntityBean";
+
+ /** The clustered BMP configuration */
+ public static final String CLUSTERED_BMP_13 = "Clustered BMP EntityBean";
+
+ /** The clustered stateful session configuration */
+ public static final String CLUSTERED_STATEFUL_13 = "Clustered Stateful SessionBean";
+
+ /** The clustered stateless session configuration */
+ public static final String CLUSTERED_STATELESS = "Clustered Stateless SessionBean";
+
+ /** Commit option A */
+ public static final byte A_COMMIT_OPTION = 0;
+
+ /** Commit option B */
+ public static final byte B_COMMIT_OPTION = 1;
+
+ /** Commit option C */
+ public static final byte C_COMMIT_OPTION = 2;
+
+ /** D_COMMIT_OPTION is a lazy load option. By default it synchronizes every 30 seconds */
+ public static final byte D_COMMIT_OPTION = 3;
+
+ /** The commit option strings */
+ public static final String[] commitOptionStrings = {"A", "B", "C", "D"};
+
+ /**
+ * Create a new ConfigurationMetaData.
+ *
+ * @param delegate the delegate
+ * @return the metadata
+ * @throws IllegalArgumentException for a null delegate or an unknown delegate
+ */
+ public static ConfigurationMetaData create(ContainerConfigurationMetaData delegate)
+ {
+ if (delegate == null)
+ throw new IllegalArgumentException("Null delegate");
+ return new ConfigurationMetaData(delegate);
+ }
+
+ /**
+ * Create a new ConfigurationMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public ConfigurationMetaData(ContainerConfigurationMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new ConfigurationMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link ContainerConfigurationMetaData}
+ */
+ protected ConfigurationMetaData(MetaData metaData)
+ {
+ super(metaData, ContainerConfigurationMetaData.class);
+ }
+
+ /**
+ * Get the containre name
+ *
+ * @return the container name
+ */
+ public String getName()
+ {
+ return getDelegate().getContainerName();
+ }
+
+ /**
+ * Get the instance pool
+ *
+ * @return the data or null if there isn't one
+ */
+ public String getInstancePool()
+ {
+ return getDelegate().getInstancePool();
+ }
+
+ /**
+ * Get the instance cache
+ *
+ * @return the data or null if there isn't one
+ */
+ public String getInstanceCache()
+ {
+ return getDelegate().getInstanceCache();
+ }
+
+ /**
+ * Get the persistence manager
+ *
+ * @return the data or null if there isn't one
+ */
+ public String getPersistenceManager()
+ {
+ return getDelegate().getPersistenceManager();
+ }
+
+ /**
+ * Get the security domain
+ *
+ * @return the data or null if there isn't one
+ */
+ public String getSecurityDomain()
+ {
+ return getDelegate().getSecurityDomain();
+ }
+
+ /**
+ * Get the invokers
+ *
+ * @return the invokers
+ */
+ public String[] getInvokers()
+ {
+ Collection<String> result = getDelegate().getInvokerProxyBindingNames();
+ if (result == null)
+ return new String[0];
+ return result.toArray(new String[result.size()]);
+ }
+
+ /**
+ * Get the web class loader
+ *
+ * @return the data or null if there isn't one
+ */
+ public String getWebClassLoader()
+ {
+ return getDelegate().getWebClassLoader();
+ }
+
+ /**
+ * Get the locking class
+ *
+ * @return the data or null if there isn't one
+ */
+ public String getLockClass()
+ {
+ return getDelegate().getLockingPolicy();
+ }
+
+ /* TODO DOM container pool conf
+ public Element getContainerPoolConf()
+ {
+ return containerPoolConf;
+ } */
+
+ /* TODO DOM container cache conf
+ public Element getContainerCacheConf()
+ {
+ return containerCacheConf;
+ } */
+
+ /**
+ * Get the default invoker name
+ *
+ * @return the default invoker
+ * @throws IllegalStateException when there are no invokers
+ */
+ public String getDefaultInvokerName()
+ {
+ return getDelegate().getDefaultInvokerName();
+ }
+
+ /* TODO DOM container interceptors conf
+ public Element getContainerInterceptorsConf()
+ {
+ return containerInterceptorsConf;
+ } */
+
+ /**
+ * Get whether call logging is enabled
+ *
+ * @return true for enabled
+ */
+ public boolean getCallLogging()
+ {
+ return getDelegate().isCallLogging();
+ }
+
+ /**
+ * Get whether sync on commit only is enabled
+ *
+ * @return true for enabled
+ */
+ public boolean getSyncOnCommitOnly()
+ {
+ return getDelegate().isSyncOnCommitOnly();
+ }
+
+ /**
+ * Get whether insert after ejb post create is enabled
+ *
+ * @return true for enabled
+ */
+ public boolean isInsertAfterEjbPostCreate()
+ {
+ return getDelegate().isInsertAfterEjbPostCreate();
+ }
+
+ /**
+ * Get whether ejbStore() for not clean is enabled
+ *
+ * @return true for enabled
+ */
+ public boolean isEjbStoreForClean()
+ {
+ return getDelegate().isEjbStoreOnClean();
+ }
+
+ /**
+ * Get whether store not flushed is enabled
+ *
+ * @return true for enabled
+ */
+ public boolean isStoreNotFlushed()
+ {
+ return getDelegate().isStoreNotFlushed();
+ }
+
+ /**
+ * Get the commit option
+ *
+ * @return the commit option
+ */
+ public byte getCommitOption()
+ {
+ CommitOption commitOption = getDelegate().getCommitOption();
+ switch (commitOption)
+ {
+ case B: return B_COMMIT_OPTION;
+ case C: return C_COMMIT_OPTION;
+ case D: return D_COMMIT_OPTION;
+ default: return A_COMMIT_OPTION;
+ }
+ }
+
+ /**
+ * Get the option d refersh rate
+ *
+ * @return the option d refresh rate
+ */
+ public long getOptionDRefreshRate()
+ {
+ return getDelegate().getOptiondRefreshRateMillis();
+ }
+
+ /**
+ * Get the cluster config
+ *
+ * @return the cluster config
+ */
+ public ClusterConfigMetaData getClusterConfigMetaData()
+ {
+ org.jboss.metadata.ejb.jboss.ClusterConfigMetaData config = getDelegate().getClusterConfig();
+ if (config == null)
+ return null;
+ return new ClusterConfigMetaData(config);
+ }
+
+ /**
+ * Get the dependencies
+ *
+ * @return the dependencies
+ */
+ public Collection<String> getDepends()
+ {
+ Collection<String> result = getDelegate().getDepends();
+ if (result == null)
+ return Collections.emptyList();
+ return result;
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/EjbLocalRefMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/EjbLocalRefMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/EjbLocalRefMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,133 @@
+/*
+ * 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 org.jboss.metadata.javaee.spec.EJBLocalReferenceMetaData;
+
+/**
+ * An ejb-local-ref encapsulation
+ *
+ * @author <a href="mailto:docodan at mvcsoft.com">Daniel OConnor</a>
+ * @author Scott.Stark at jboss.org
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 57300 $
+ */
+ at Deprecated
+public class EjbLocalRefMetaData extends OldMetaData<EJBLocalReferenceMetaData>
+{
+ /**
+ * Create a new EjbLocalRefMetaData.
+ *
+ * @param delegate the delegate
+ * @return the metadata
+ * @throws IllegalArgumentException for a null delegate or an unknown delegate
+ */
+ public static EjbLocalRefMetaData create(EJBLocalReferenceMetaData delegate)
+ {
+ if (delegate == null)
+ throw new IllegalArgumentException("Null delegate");
+ return new EjbLocalRefMetaData(delegate);
+ }
+
+ /**
+ * Create a new EjbLocalRefMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public EjbLocalRefMetaData(EJBLocalReferenceMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Get the home.
+ *
+ * @return the home.
+ */
+ public String getLocalHome()
+ {
+ return getDelegate().getLocalHome();
+ }
+
+ /**
+ * Get the jndiName.
+ *
+ * @return the jndiName.
+ */
+ public String getJndiName()
+ {
+ return getDelegate().getMappedName();
+ }
+
+ /**
+ * Get the link.
+ *
+ * @return the link.
+ */
+ public String getLink()
+ {
+ return getDelegate().getLink();
+ }
+
+ /**
+ * Get the name.
+ *
+ * @return the name.
+ */
+ public String getName()
+ {
+ return getDelegate().getName();
+ }
+
+ /**
+ * Get the local.
+ *
+ * @return the local.
+ */
+ public String getLocal()
+ {
+ return getDelegate().getLocal();
+ }
+
+ /**
+ * Get the type.
+ *
+ * @return the type.
+ */
+ public String getType()
+ {
+ return getDelegate().getType();
+ }
+
+ /**
+ * Get the invoker binding
+ *
+ * @param bindingName the binding name
+ * @return the invoker binding or null if not found
+ * @throws UnsupportedOperationException always
+ */
+ public String getInvokerBinding(String bindingName)
+ {
+ throw new UnsupportedOperationException("local refs have to external invokers");
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/EjbRefMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/EjbRefMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/EjbRefMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,132 @@
+/*
+ * 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 org.jboss.metadata.javaee.spec.EJBReferenceMetaData;
+
+/**
+ * An ejb-ref encapsulation
+ *
+ * @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini</a>
+ * @author Scott.Stark at jboss.org
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 57300 $
+ */
+ at Deprecated
+public class EjbRefMetaData extends OldMetaData<EJBReferenceMetaData>
+{
+ /**
+ * Create a new EjbRefMetaData.
+ *
+ * @param delegate the delegate
+ * @return the metadata
+ * @throws IllegalArgumentException for a null delegate or an unknown delegate
+ */
+ public static EjbRefMetaData create(EJBReferenceMetaData delegate)
+ {
+ if (delegate == null)
+ throw new IllegalArgumentException("Null delegate");
+ return new EjbRefMetaData(delegate);
+ }
+
+ /**
+ * Create a new EjbRefMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public EjbRefMetaData(EJBReferenceMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Get the home.
+ *
+ * @return the home.
+ */
+ public String getHome()
+ {
+ return getDelegate().getHome();
+ }
+
+ /**
+ * Get the jndiName.
+ *
+ * @return the jndiName.
+ */
+ public String getJndiName()
+ {
+ return getDelegate().getMappedName();
+ }
+
+ /**
+ * Get the link.
+ *
+ * @return the link.
+ */
+ public String getLink()
+ {
+ return getDelegate().getLink();
+ }
+
+ /**
+ * Get the name.
+ *
+ * @return the name.
+ */
+ public String getName()
+ {
+ return getDelegate().getName();
+ }
+
+ /**
+ * Get the remote.
+ *
+ * @return the remote.
+ */
+ public String getRemote()
+ {
+ return getDelegate().getRemote();
+ }
+
+ /**
+ * Get the type.
+ *
+ * @return the type.
+ */
+ public String getType()
+ {
+ return getDelegate().getType();
+ }
+
+ /**
+ * Get the invoker binding
+ *
+ * @param bindingName the binding name
+ * @return the invoker binding or null if not found
+ */
+ public String getInvokerBinding(String bindingName)
+ {
+ return getDelegate().getInvokerBinding(bindingName);
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/EntityMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/EntityMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/EntityMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,292 @@
+/*
+* 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 java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.jboss.JBossEntityBeanMetaData;
+import org.jboss.metadata.ejb.spec.CMPFieldsMetaData;
+import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.spec.EntityBeanMetaData;
+import org.jboss.metadata.ejb.spec.QueriesMetaData;
+import org.jboss.metadata.javaee.spec.SecurityRoleRefsMetaData;
+import org.jboss.metadata.spi.MetaData;
+
+/**
+ * The meta data information specific to entity beans.
+ *
+ * @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini</a>
+ * @author <a href="mailto:scott.stark at jboss.org">Scott Stark</a>
+ * @author <a href="mailto:dain at daingroup.com">Dain Sundstrom</a>
+ * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
+ * @author <a href="mailto:criege at riege.com">Christian Riege</a>
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ */
+ at Deprecated
+public class EntityMetaData extends BeanMetaData
+{
+ /** CMP Version 1 */
+ public final static int CMP_VERSION_1 = 1;
+
+ /** CMP Version 2 */
+ public final static int CMP_VERSION_2 = 2;
+
+ /** The default entity bean invoker */
+ public static final String DEFAULT_ENTITY_INVOKER_PROXY_BINDING = "entity-unified-invoker";
+
+ /** The default clustered entity invoker */
+ public static final String DEFAULT_CLUSTERED_ENTITY_INVOKER_PROXY_BINDING = "clustered-entity-rmi-invoker";
+
+ /**
+ * Create a new EntityBeanMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ protected EntityMetaData(JBossEnterpriseBeanMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new EntityMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link EnterpriseBeanMetaData}
+ */
+ protected EntityMetaData(MetaData metaData)
+ {
+ super(metaData);
+ }
+
+ @Override
+ public JBossEntityBeanMetaData getDelegate()
+ {
+ return (JBossEntityBeanMetaData) super.getDelegate();
+ }
+
+ @Override
+ public EntityBeanMetaData getOverridenDelegate()
+ {
+ return (EntityBeanMetaData) super.getOverridenDelegate();
+ }
+
+ @Override
+ public String getHome()
+ {
+ return getOverridenDelegate().getHome();
+ }
+
+ @Override
+ public String getLocal()
+ {
+ return getOverridenDelegate().getLocal();
+ }
+
+ @Override
+ public String getLocalHome()
+ {
+ return getOverridenDelegate().getLocalHome();
+ }
+
+ @Override
+ public String getRemote()
+ {
+ return getOverridenDelegate().getRemote();
+ }
+
+ @Override
+ public String getServiceEndpoint()
+ {
+ return null;
+ }
+
+ /**
+ * Is this container managed persistence
+ *
+ * @return true for cmp
+ */
+ public boolean isCMP()
+ {
+ return getOverridenDelegate().isCMP();
+ }
+
+ /**
+ * Is this CMP1x
+ *
+ * @return true for version 1.x
+ */
+ public boolean isCMP1x()
+ {
+ return getOverridenDelegate().isCMP1x();
+ }
+
+ /**
+ * Is this CMP1x
+ *
+ * @return true for version 2.x
+ */
+ public boolean isCMP2x()
+ {
+ return isCMP1x() == false;
+ }
+
+ public boolean isBMP()
+ {
+ return getOverridenDelegate().isBMP();
+ }
+
+ /**
+ * Get the primary key class
+ *
+ * @return the primary key class
+ */
+ public String getPrimaryKeyClass()
+ {
+ return getOverridenDelegate().getPrimKeyClass();
+ }
+
+ /**
+ * Is the entity reentrant
+ *
+ * @return true for reentrant
+ */
+ public boolean isReentrant()
+ {
+ return getOverridenDelegate().isReentrant();
+ }
+
+ /**
+ * Get the abstract schema name
+ *
+ * @return the abstract schema name
+ */
+ public String getAbstractSchemaName()
+ {
+ return getOverridenDelegate().getAbstractSchemaName();
+ }
+
+ /**
+ * Gets the container managed fields.
+ *
+ * @return iterator over Strings containing names of the fields
+ */
+ public Iterator<String> getCMPFields()
+ {
+ CMPFieldsMetaData result = getOverridenDelegate().getCmpFields();
+ if (result != null)
+ return new CMPFieldIterator(result);
+ List<String> list = Collections.emptyList();
+ return list.iterator();
+ }
+
+ /**
+ * Get the primary key field
+ *
+ * @return the primary key field
+ */
+ public String getPrimKeyField()
+ {
+ return getOverridenDelegate().getPrimKeyField();
+ }
+
+ public Iterator<QueryMetaData> getQueries()
+ {
+ QueriesMetaData result = getOverridenDelegate().getQueries();
+ return new OldMetaDataIterator<org.jboss.metadata.ejb.spec.QueryMetaData, QueryMetaData>(result, org.jboss.metadata.ejb.spec.QueryMetaData.class, QueryMetaData.class);
+ }
+
+ @Override
+ public String getJndiName()
+ {
+ return getDelegate().determineJndiName();
+ }
+
+ @Override
+ public boolean isCallByValue()
+ {
+ return getDelegate().isCallByValue();
+ }
+
+ @Override
+ public boolean isClustered()
+ {
+ return getDelegate().isClustered();
+ }
+
+ @Override
+ public ClusterConfigMetaData getClusterConfigMetaData()
+ {
+ org.jboss.metadata.ejb.jboss.ClusterConfigMetaData config = getDelegate().determineClusterConfig();
+ return new ClusterConfigMetaData(config);
+ }
+
+ /**
+ * Whether the bean is read only
+ *
+ * @return true when read only
+ */
+ public boolean isReadOnly()
+ {
+ return getDelegate().isReadOnly();
+ }
+
+ @Override
+ public Iterator<SecurityRoleRefMetaData> getSecurityRoleReferences()
+ {
+ SecurityRoleRefsMetaData roleRefs = getOverridenDelegate().getSecurityRoleRefs();
+ return new OldMetaDataIterator<org.jboss.metadata.javaee.spec.SecurityRoleRefMetaData, SecurityRoleRefMetaData>(roleRefs, org.jboss.metadata.javaee.spec.SecurityRoleRefMetaData.class, SecurityRoleRefMetaData.class);
+ }
+
+ @Override
+ public SecurityIdentityMetaData getEjbTimeoutIdentity()
+ {
+ throw new UnsupportedOperationException("Entity beans do not have an ejb timeout identity");
+ }
+
+ /**
+ * Whether to do cache invalidations
+ *
+ * @return true when cache invalidations are required
+ */
+ public boolean doDistributedCacheInvalidations()
+ {
+ return getDelegate().isCacheInvalidation();
+ }
+
+ /**
+ * The cache invalidation config
+ *
+ * @return the config
+ */
+ public CacheInvalidationConfigMetaData getDistributedCacheInvalidationConfig()
+ {
+ org.jboss.metadata.ejb.jboss.CacheInvalidationConfigMetaData config = getDelegate().getCacheInvalidationConfig();
+ if (config == null)
+ return null;
+ return new CacheInvalidationConfigMetaData(config);
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/EnvEntryMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/EnvEntryMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/EnvEntryMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,90 @@
+/*
+ * 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 org.jboss.metadata.javaee.spec.EnvironmentEntryMetaData;
+
+/**
+ * Environment Entry metadata
+ *
+ * @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini </a>
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 57300 $
+ */
+ at Deprecated
+public class EnvEntryMetaData extends OldMetaData<EnvironmentEntryMetaData>
+{
+ /**
+ * Create a new EnvEntryMetaData.
+ *
+ * @param delegate the delegate
+ * @return the metadata
+ * @throws IllegalArgumentException for a null delegate or an unknown delegate
+ */
+ public static EnvEntryMetaData create(EnvironmentEntryMetaData delegate)
+ {
+ if (delegate == null)
+ throw new IllegalArgumentException("Null delegate");
+ return new EnvEntryMetaData(delegate);
+ }
+
+ /**
+ * Create a new EnvEntryMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public EnvEntryMetaData(EnvironmentEntryMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Get the name.
+ *
+ * @return the name.
+ */
+ public String getName()
+ {
+ return getDelegate().getName();
+ }
+
+ /**
+ * Get the type.
+ *
+ * @return the type.
+ */
+ public String getType()
+ {
+ return getDelegate().getType();
+ }
+
+ /**
+ * Get the value.
+ *
+ * @return the value.
+ */
+ public String getValue()
+ {
+ return getDelegate().getValue();
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/ExcludedMethodMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ExcludedMethodMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/ExcludedMethodMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,49 @@
+/*
+* 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;
+
+/**
+ * ExcludedMethodMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Deprecated
+class ExcludedMethodMetaData extends MethodMetaData<org.jboss.metadata.ejb.spec.ExcludeListMetaData>
+{
+ /**
+ * Create a new PermissionMethodMetaData.
+ *
+ * @param delegate the delegatre
+ * @param methodDelegate the method delegate
+ * @throws IllegalArgumentException for a null delegate or methodDelegate
+ */
+ public ExcludedMethodMetaData(org.jboss.metadata.ejb.spec.ExcludeListMetaData delegate, org.jboss.metadata.ejb.spec.MethodMetaData methodDelegate)
+ {
+ super(delegate, methodDelegate);
+ }
+
+ public boolean isExcluded()
+ {
+ return true;
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/ExcludedMethodMetaDataIterator.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ExcludedMethodMetaDataIterator.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/ExcludedMethodMetaDataIterator.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,81 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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 java.util.Iterator;
+import java.util.NoSuchElementException;
+
+import org.jboss.metadata.ejb.spec.ExcludeListMetaData;
+import org.jboss.metadata.ejb.spec.MethodsMetaData;
+
+/**
+ * ExcludedMethodMetaDataIterator.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Deprecated
+class ExcludedMethodMetaDataIterator implements Iterator<MethodMetaData>
+{
+ /** The exclude list */
+ private ExcludeListMetaData excludeList;
+
+ /** The delegate */
+ private Iterator<org.jboss.metadata.ejb.spec.MethodMetaData> delegate;
+
+ /**
+ * Create a new ExcludedMethod iterator
+ *
+ * @param excluded the excluded methods
+ */
+ public ExcludedMethodMetaDataIterator(ExcludeListMetaData excluded)
+ {
+ if (excluded == null)
+ return;
+ this.excludeList = excluded;
+ MethodsMetaData methods = excluded.getMethods();
+ if (methods == null)
+ return;
+ delegate = methods.iterator();
+ }
+
+ public boolean hasNext()
+ {
+ if (delegate == null)
+ return false;
+ return delegate.hasNext();
+ }
+
+ public MethodMetaData next()
+ {
+ if (delegate == null)
+ throw new NoSuchElementException("No next");
+
+ org.jboss.metadata.ejb.spec.MethodMetaData theMethod = delegate.next();
+ return new ExcludedMethodMetaData(excludeList, theMethod);
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException("remove");
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/InvokerBindingsIterator.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/InvokerBindingsIterator.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/InvokerBindingsIterator.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,74 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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 java.util.Iterator;
+import java.util.NoSuchElementException;
+
+import org.jboss.metadata.ejb.jboss.InvokerBindingMetaData;
+import org.jboss.metadata.ejb.jboss.InvokerBindingsMetaData;
+
+/**
+ * InvokerBindingsIterator.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Deprecated
+class InvokerBindingsIterator implements Iterator<String>
+{
+ /** The delegate */
+ private Iterator<InvokerBindingMetaData> delegate;
+
+ /**
+ * Create a new InvokerBindings iterator
+ *
+ * @param bindings the bindings
+ */
+ public InvokerBindingsIterator(InvokerBindingsMetaData bindings)
+ {
+ if (bindings == null)
+ return;
+ delegate = bindings.iterator();
+ }
+
+ public boolean hasNext()
+ {
+ if (delegate == null)
+ return false;
+ return delegate.hasNext();
+ }
+
+ public String next()
+ {
+ if (delegate == null)
+ throw new NoSuchElementException("No next");
+
+ InvokerBindingMetaData next = delegate.next();
+ return next.getInvokerProxyBindingName();
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException("remove");
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/InvokerProxyBindingMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/InvokerProxyBindingMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/InvokerProxyBindingMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,114 @@
+/*
+* 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 org.jboss.metadata.spi.MetaData;
+
+
+/**
+ * The configuration information for invoker-proxy bindingss that may be
+ * tied to a EJB container.
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 37390 $
+ */
+ at Deprecated
+public class InvokerProxyBindingMetaData extends OldMetaData<org.jboss.metadata.ejb.jboss.InvokerProxyBindingMetaData>
+{
+ /**
+ * Create a new InvokerProxyBindingMetaData.
+ *
+ * @param delegate the delegate
+ * @return the metadata
+ * @throws IllegalArgumentException for a null delegate or an unknown delegate
+ */
+ public static InvokerProxyBindingMetaData create(org.jboss.metadata.ejb.jboss.InvokerProxyBindingMetaData delegate)
+ {
+ if (delegate == null)
+ throw new IllegalArgumentException("Null delegate");
+ return new InvokerProxyBindingMetaData(delegate);
+ }
+
+ /**
+ * Create a new InvokerProxyBindingMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public InvokerProxyBindingMetaData(org.jboss.metadata.ejb.jboss.InvokerProxyBindingMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new InvokerProxyBindingMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link org.jboss.metadata.ejb.jboss.InvokerProxyBindingMetaData}
+ */
+ protected InvokerProxyBindingMetaData(MetaData metaData)
+ {
+ super(metaData, org.jboss.metadata.ejb.jboss.InvokerProxyBindingMetaData.class);
+ }
+
+ /**
+ * Get the unique name of the invoker proxy binding
+ *
+ * @return the name
+ */
+ public String getName()
+ {
+ return getDelegate().getInvokerProxyBindingName();
+ }
+
+ /**
+ * Get the detached invoker MBean service name associated with the proxy
+ *
+ * @return the invoker name
+ */
+ public String getInvokerMBean()
+ {
+ return getDelegate().getInvokerMBean();
+ }
+
+ /**
+ * Get the class name of the org.jboss.ejb.EJBProxyFactory implementation
+ * used to create proxies for this configuration
+ *
+ * @return the proxy factory
+ */
+ public String getProxyFactory()
+ {
+ return getDelegate().getProxyFactory();
+ }
+
+ /**
+ * An arbitary configuration to pass to the EJBProxyFactory implementation
+ */
+ /* TODO DOM - proxy factory config
+ public Element getProxyFactoryConfig()
+ {
+ return proxyFactoryConfig;
+ } */
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/IorSecurityConfigMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/IorSecurityConfigMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/IorSecurityConfigMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,502 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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 java.io.Serializable;
+
+import org.jboss.metadata.ejb.jboss.IORASContextMetaData;
+import org.jboss.metadata.ejb.jboss.IORSASContextMetaData;
+import org.jboss.metadata.ejb.jboss.IORSecurityConfigMetaData;
+import org.jboss.metadata.ejb.jboss.IORTransportConfigMetaData;
+
+/**
+ * Describes the security configuration information for the IOR.
+ *
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
+ * @version <tt>$Revision: 57209 $</tt>
+ */
+public class IorSecurityConfigMetaData implements Serializable
+{
+ /** @since 1.7 */
+ private static final long serialVersionUID = -3341898910508715334L;
+
+ /**
+ * The root element for security between the end points.
+ * Optional element.
+ */
+ private TransportConfig transportConfig;
+
+ /**
+ * as-context (CSIv2 authentication service) is the element describing the authentication
+ * mechanism that will be used to authenticate the client. If specified it will be the
+ * username-password mechanism.
+ * Optional element.
+ */
+ private AsContext asContext;
+
+ /**
+ * sas-context (related to CSIv2 security attribute service) element describes the sas-context fields.
+ */
+ private SasContext sasContext;
+
+ /** Create a default security configuration.
+ * TransportConfig[integrity=supported, confidentiality=supported,
+ * establish-trust-in-target=supported,establish-trust-in-client=supported,
+ * detect-misordering=supported, detect-replay=supported]
+ * AsContext[auth-method=USERNAME_PASSWORD, realm=default, required=false]
+ * SasContext[caller-propagation=NONE]
+ */
+ public IorSecurityConfigMetaData()
+ {
+ transportConfig = new TransportConfig();
+ asContext = new AsContext();
+ sasContext = new SasContext();
+ }
+
+ /**
+ * Create a new IorSecurityConfigMetaData.
+ *
+ * @param securityConfigMetaData the security config
+ */
+ IorSecurityConfigMetaData(IORSecurityConfigMetaData securityConfigMetaData)
+ {
+ if (securityConfigMetaData == null)
+ throw new IllegalArgumentException("Null security config metadata");
+ transportConfig = new TransportConfig(securityConfigMetaData.getTransportConfig());
+ asContext = new AsContext(securityConfigMetaData.getAsContext());
+ sasContext = new SasContext(securityConfigMetaData.getSasContext());
+ }
+
+ /**
+ * Get the transport config
+ *
+ * @return the transport config
+ */
+ public TransportConfig getTransportConfig()
+ {
+ return transportConfig;
+ }
+
+ /**
+ * Set the transport config
+ *
+ * @param config the transport config
+ */
+ public void setTransportConfig(TransportConfig config)
+ {
+ this.transportConfig = config;
+ }
+
+ /**
+ * Get the as context
+ *
+ * @return the as context
+ */
+ public AsContext getAsContext()
+ {
+ return asContext;
+ }
+
+ /**
+ * Set the as context
+ *
+ * @param context the as context
+ */
+ public void setAsContext(AsContext context)
+ {
+ this.asContext = context;
+ }
+
+ /**
+ * Get the Sas context
+ *
+ * @return the sas context
+ */
+ public SasContext getSasContext()
+ {
+ return sasContext;
+ }
+
+ /**
+ * Set the sas context
+ *
+ * @param context the sas context
+ */
+ public void setSasContext(SasContext context)
+ {
+ this.sasContext = context;
+ }
+
+ @Override
+ public String toString()
+ {
+ return
+ "[transport-config=" + transportConfig +
+ ", as-context=" + asContext +
+ ", sas-context=" + sasContext + "]";
+ }
+
+ /**
+ * The root element for security between the end points
+ */
+ public class TransportConfig
+ {
+ public static final String INTEGRITY_NONE = "NONE";
+ public static final String INTEGRITY_SUPPORTED = "SUPPORTED";
+ public static final String INTEGRITY_REQUIRED = "REQUIRED";
+
+ public static final String CONFIDENTIALITY_NONE = "NONE";
+ public static final String CONFIDENTIALITY_SUPPORTED = "SUPPORTED";
+ public static final String CONFIDENTIALITY_REQUIRED = "REQUIRED";
+
+ public static final String DETECT_MISORDERING_NONE = "NONE";
+ public static final String DETECT_MISORDERING_SUPPORTED = "SUPPORTED";
+ public static final String DETECT_MISORDERING_REQUIRED = "REQUIRED";
+
+ public static final String DETECT_REPLAY_NONE = "NONE";
+ public static final String DETECT_REPLAY_SUPPORTED = "SUPPORTED";
+ public static final String DETECT_REPLAY_REQUIRED = "REQUIRED";
+
+ public static final String ESTABLISH_TRUST_IN_TARGET_NONE = "NONE";
+ public static final String ESTABLISH_TRUST_IN_TARGET_SUPPORTED = "SUPPORTED";
+
+ public static final String ESTABLISH_TRUST_IN_CLIENT_NONE = "NONE";
+ public static final String ESTABLISH_TRUST_IN_CLIENT_SUPPORTED = "SUPPORTED";
+ public static final String ESTABLISH_TRUST_IN_CLIENT_REQUIRED = "REQUIRED";
+
+ /**
+ * integrity element indicates if the server (target) supports integrity protected messages.
+ * The valid values are NONE, SUPPORTED or REQUIRED.
+ * Required element.
+ */
+ private final String integrity;
+
+ /**
+ * confidentiality element indicates if the server (target) supports privacy protected
+ * messages. The values are NONE, SUPPORTED or REQUIRED.
+ * Required element.
+ */
+ private final String confidentiality;
+
+ /**
+ * detect-misordering indicates if the server (target) supports detection
+ * of message sequence errors. The values are NONE, SUPPORTED or REQUIRED.
+ * Optional element.
+ */
+ private final String detectMisordering;
+
+ /**
+ * detect-replay indicates if the server (target) supports detection
+ * of message replay attempts. The values are NONE, SUPPORTED or REQUIRED.
+ * Optional element.
+ */
+ private final String detectReplay;
+
+ /**
+ * establish-trust-in-target element indicates if the target is capable of authenticating to a client.
+ * The values are NONE or SUPPORTED.
+ * Required element.
+ */
+ private final String establishTrustInTarget;
+
+ /**
+ * establish-trust-in-client element indicates if the target is capable of authenticating a client. The
+ * values are NONE, SUPPORTED or REQUIRED.
+ * Required element.
+ */
+ private final String establishTrustInClient;
+
+ /**
+ * Create a new TransportConfig.
+ */
+ private TransportConfig()
+ {
+ integrity = INTEGRITY_SUPPORTED;
+ confidentiality = CONFIDENTIALITY_SUPPORTED;
+ establishTrustInTarget = ESTABLISH_TRUST_IN_TARGET_SUPPORTED;
+ establishTrustInClient = ESTABLISH_TRUST_IN_CLIENT_SUPPORTED;
+ this.detectMisordering = DETECT_MISORDERING_SUPPORTED;
+ this.detectReplay = DETECT_REPLAY_SUPPORTED;
+ }
+
+ /**
+ * Create a new TransportConfig.
+ *
+ * @param tranportConfig the delegate
+ */
+ private TransportConfig(IORTransportConfigMetaData tranportConfig)
+ {
+ if (tranportConfig == null)
+ throw new IllegalArgumentException("Null transport config");
+ integrity = tranportConfig.getIntegrity();
+ confidentiality = tranportConfig.getIntegrity();
+ establishTrustInClient = tranportConfig.getEstablishTrustInClient();
+ establishTrustInTarget = tranportConfig.getEstablishTrustInTarget();
+ detectReplay = tranportConfig.getDetectReplay();
+ detectMisordering = tranportConfig.getDetectMisordering();
+ }
+
+ /**
+ * Get the integrity
+ *
+ * @return the integrity
+ */
+ public String getIntegrity()
+ {
+ return integrity;
+ }
+
+ /**
+ * Get the confidentiality
+ *
+ * @return the confidentiality
+ */
+ public String getConfidentiality()
+ {
+ return confidentiality;
+ }
+
+ /**
+ * Get the detect misordering
+ *
+ * @return the detect misordering
+ */
+ public String getDetectMisordering()
+ {
+ return detectMisordering;
+ }
+
+ /**
+ * Get the detect replay
+ *
+ * @return the detect replay
+ */
+ public String getDetectReplay()
+ {
+ return detectReplay;
+ }
+
+ /**
+ * Get the establish trust in target
+ *
+ * @return the establish trust in target
+ */
+ public String getEstablishTrustInTarget()
+ {
+ return establishTrustInTarget;
+ }
+
+ /**
+ * Whether establish trust in target is support
+ *
+ * @return true when it is supported
+ */
+ public boolean isEstablishTrustInTargetSupported()
+ {
+ return ESTABLISH_TRUST_IN_TARGET_SUPPORTED.equalsIgnoreCase(establishTrustInTarget);
+ }
+
+ /**
+ * Get the establish trust in client
+ *
+ * @return the establish trust in client
+ */
+ public String getEstablishTrustInClient()
+ {
+ return establishTrustInClient;
+ }
+
+ @Override
+ public String toString()
+ {
+ return
+ "[integrity=" + integrity +
+ ", confidentiality=" + confidentiality +
+ ", establish-trust-in-target=" + establishTrustInTarget +
+ ", establish-trust-in-client=" + establishTrustInClient +
+ ", detect-misordering=" + detectMisordering +
+ ", detect-replay=" + detectReplay + "]";
+ }
+ }
+
+ /**
+ * as-context (CSIv2 authentication service) is the element describing the authentication
+ * mechanism that will be used to authenticate the client. It can be either
+ * the username-password mechanism, or none (default).
+ */
+ public class AsContext
+ {
+ public static final String AUTH_METHOD_USERNAME_PASSWORD = "USERNAME_PASSWORD";
+ public static final String AUTH_METHOD_NONE = "NONE";
+
+ /**
+ * auth-method element describes the authentication method. The only supported values
+ * are USERNAME_PASSWORD and NONE.
+ * Required element.
+ */
+ private final String authMethod;
+
+ /**
+ * realm element describes the realm in which the user is authenticated. Must be
+ * a valid realm that is registered in server configuration.
+ * Required element.
+ */
+ private final String realm;
+
+ /**
+ * required element specifies if the authentication method specified is required
+ * to be used for client authentication. If so the EstablishTrustInClient bit
+ * will be set in the target_requires field of the AS_Context. The element value
+ * is either true or false.
+ * Required element.
+ */
+ private final boolean required;
+
+ /**
+ * Create a new AsContext.
+ */
+ private AsContext()
+ {
+ authMethod = AUTH_METHOD_USERNAME_PASSWORD;
+ realm = "default";
+ required = false;
+ }
+
+ /**
+ * Create a new AsContext
+ *
+ * @param asContext the delegate
+ */
+ private AsContext(IORASContextMetaData asContext)
+ {
+ if (asContext == null)
+ throw new IllegalArgumentException("Null asContext");
+ authMethod = asContext.getAuthMethod();
+ realm = asContext.getRealm();
+ required = asContext.isRequired();
+ }
+
+ /**
+ * Get the auth method
+ *
+ * @return the auth method
+ */
+ public String getAuthMethod()
+ {
+ return authMethod;
+ }
+
+ /**
+ * Get the realm
+ *
+ * @return the realm
+ */
+ public String getRealm()
+ {
+ return realm;
+ }
+
+ /**
+ * Whether it is required
+ *
+ * @return true when required
+ */
+ public boolean isRequired()
+ {
+ return required;
+ }
+
+ @Override
+ public String toString()
+ {
+ return
+ "[auth-method=" + authMethod +
+ ", realm=" + realm +
+ ", required=" + required + "]";
+ }
+ }
+
+ /**
+ * sas-context (related to CSIv2 security attribute service) element describes
+ * the sas-context fields.
+ */
+ public class SasContext
+ {
+ public static final String CALLER_PROPAGATION_NONE = "NONE";
+ public static final String CALLER_PROPAGATION_SUPPORTED = "SUPPORTED";
+
+ /**
+ * caller-propagation element indicates if the target will accept propagated caller identities
+ * The values are NONE or SUPPORTED.
+ * Required element.
+ */
+ private final String callerPropagation;
+
+ /**
+ * Create a new SasContext.
+ */
+ private SasContext()
+ {
+ callerPropagation = CALLER_PROPAGATION_NONE;
+ }
+
+ /**
+ * Create a new SasContext.
+ *
+ * @param sasContext the delegate
+ */
+ private SasContext(IORSASContextMetaData sasContext)
+ {
+ if (sasContext == null)
+ throw new IllegalArgumentException("Null sasContext");
+ callerPropagation = sasContext.getCallerPropagation();
+ }
+
+ /**
+ * Get the caller propagation
+ *
+ * @return the caller propagation
+ */
+ public String getCallerPropagation()
+ {
+ return callerPropagation;
+ }
+
+ /**
+ * Whether caller propagation is supported
+ *
+ * @return true when propagation is supported
+ */
+ public boolean isCallerPropagationSupported()
+ {
+ return CALLER_PROPAGATION_SUPPORTED.equalsIgnoreCase(callerPropagation);
+ }
+
+ @Override
+ public String toString()
+ {
+ return "[caller-propagation=" + callerPropagation + "]";
+ }
+ }
+}
+
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/MessageDestinationMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/MessageDestinationMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/MessageDestinationMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,76 @@
+/*
+* 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 org.jboss.metadata.spi.MetaData;
+
+/**
+ * Message Destination Metadata
+ *
+ * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>.
+ * @version $Revision: 37390 $
+ */
+public class MessageDestinationMetaData extends OldMetaData<org.jboss.metadata.javaee.spec.MessageDestinationMetaData>
+{
+ /**
+ * Create a new MessageDestinationMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public MessageDestinationMetaData(org.jboss.metadata.javaee.spec.MessageDestinationMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new MessageDestinationMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link MessageDestinationMetaData}
+ */
+ protected MessageDestinationMetaData(MetaData metaData)
+ {
+ super(metaData, org.jboss.metadata.javaee.spec.MessageDestinationMetaData.class);
+ }
+
+ /**
+ * Get the destination name
+ *
+ * @return the destination name
+ */
+ public String getName()
+ {
+ return getDelegate().getMessageDestinationName();
+ }
+
+ /**
+ * Get the jndi name
+ *
+ * @return the jndi name
+ */
+ public String getJNDIName()
+ {
+ return getDelegate().getMappedName();
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/MessageDestinationRefMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/MessageDestinationRefMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/MessageDestinationRefMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,138 @@
+/*
+* 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 org.jboss.metadata.javaee.spec.MessageDestinationReferenceMetaData;
+import org.jboss.metadata.javaee.spec.MessageDestinationUsageType;
+
+/**
+ * Message Destination Reference Metadata
+ *
+ * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>.
+ * @version $Revision: 57300 $
+ */
+ at Deprecated
+public class MessageDestinationRefMetaData extends OldMetaData<MessageDestinationReferenceMetaData>
+{
+ /** Whether this consumes */
+ public static final int CONSUMES = 1;
+
+ /** Whether this produces */
+ public static final int PRODUCES = 2;
+
+ /** Whether this consumes and produces */
+ public static final int CONSUMESPRODUCES = 3;
+
+ /**
+ * Create a new MessageDestinationRefMetaData.
+ *
+ * @param delegate the delegate
+ * @return the metadata
+ * @throws IllegalArgumentException for a null delegate or an unknown delegate
+ */
+ public static MessageDestinationRefMetaData create(MessageDestinationReferenceMetaData delegate)
+ {
+ if (delegate == null)
+ throw new IllegalArgumentException("Null delegate");
+ return new MessageDestinationRefMetaData(delegate);
+ }
+
+ /**
+ * Create a new MesssageDestinationRefMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public MessageDestinationRefMetaData(MessageDestinationReferenceMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Get the jndi name
+ *
+ * @return the jndi name
+ */
+ public String getJNDIName()
+ {
+ return getJndiName();
+ }
+
+ /**
+ * Get the jndiName.
+ *
+ * @return the jndiName.
+ */
+ public String getJndiName()
+ {
+ return getDelegate().getMappedName();
+ }
+
+ /**
+ * Get the link.
+ *
+ * @return the link.
+ */
+ public String getLink()
+ {
+ return getDelegate().getLink();
+ }
+
+ /**
+ * Get the refName.
+ *
+ * @return the refName.
+ */
+ public String getRefName()
+ {
+ return getDelegate().getName();
+ }
+
+ /**
+ * Get the type.
+ *
+ * @return the type.
+ */
+ public String getType()
+ {
+ return getDelegate().getType();
+ }
+
+ /**
+ * Get the usage.
+ *
+ * @return the usage.
+ */
+ public int getUsage()
+ {
+ MessageDestinationUsageType usage = getDelegate().getMessageDestinationUsage();
+ if (usage == null)
+ return 0;
+ if (usage == MessageDestinationUsageType.Consumes)
+ return CONSUMES;
+ if (usage == MessageDestinationUsageType.Produces)
+ return PRODUCES;
+ if (usage == MessageDestinationUsageType.ConsumesProduces)
+ return CONSUMESPRODUCES;
+ return 0;
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/MessageDrivenMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/MessageDrivenMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/MessageDrivenMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,442 @@
+/*
+* 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 java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+
+import javax.jms.Message;
+import javax.jms.Session;
+
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMessageDrivenBeanMetaData;
+import org.jboss.metadata.ejb.spec.ActivationConfigMetaData;
+import org.jboss.metadata.ejb.spec.ActivationConfigPropertiesMetaData;
+import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.spec.MessageDrivenBeanMetaData;
+import org.jboss.metadata.ejb.spec.SubscriptionDurability;
+import org.jboss.invocation.InvocationType;
+import org.jboss.metadata.spi.MetaData;
+
+/**
+ * Provides a container and parser for the metadata of a message driven bean.
+ *
+ * <p>Have to add changes ApplicationMetaData and ConfigurationMetaData.
+ *
+ * @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini</a>
+ * @author <a href="mailto:peter.antman at tim.se">Peter Antman</a>
+ * @author <a href="mailto:andreas at jboss.org">Andreas Schaefer</a>
+ * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 37459 $
+ */
+ at Deprecated
+public class MessageDrivenMetaData extends BeanMetaData
+{
+ /** Auto Acknowledge */
+ public static final int AUTO_ACKNOWLEDGE_MODE = Session.AUTO_ACKNOWLEDGE;
+
+ /** DUPS_OK */
+ public static final int DUPS_OK_ACKNOWLEDGE_MODE = Session.DUPS_OK_ACKNOWLEDGE;
+
+ /** Client Acknowledge */
+ public static final int CLIENT_ACKNOWLEDGE_MODE = Session.CLIENT_ACKNOWLEDGE;
+
+ /** Durable subscription */
+ public static final byte DURABLE_SUBSCRIPTION = 0;
+
+ /** NonDurable subscription */
+ public static final byte NON_DURABLE_SUBSCRIPTION = 1;
+
+ /** Transaction unset */
+ public static final byte TX_UNSET = 9;
+
+ /** The default message driven invoker */
+ public static final String DEFAULT_MESSAGE_DRIVEN_BEAN_INVOKER_PROXY_BINDING = "message-driven-bean";
+
+ /** The default listener type */
+ public static final String DEFAULT_MESSAGING_TYPE = "javax.jms.MessageListener";
+
+ /** The cached transaction type */
+ private transient byte methodTransactionType = TX_UNSET;
+
+ /**
+ * Create a new MessageDrivenBeanMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ protected MessageDrivenMetaData(JBossEnterpriseBeanMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new MessageDrivenMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link EnterpriseBeanMetaData}
+ */
+ protected MessageDrivenMetaData(MetaData metaData)
+ {
+ super(metaData);
+ }
+
+ @Override
+ public JBossMessageDrivenBeanMetaData getDelegate()
+ {
+ return (JBossMessageDrivenBeanMetaData) super.getDelegate();
+ }
+
+ @Override
+ public MessageDrivenBeanMetaData getOverridenDelegate()
+ {
+ return (MessageDrivenBeanMetaData) super.getOverridenDelegate();
+ }
+
+ @Override
+ public String getHome()
+ {
+ return null;
+ }
+
+ @Override
+ public String getLocal()
+ {
+ return null;
+ }
+
+ @Override
+ public String getLocalHome()
+ {
+ return null;
+ }
+
+ @Override
+ public String getRemote()
+ {
+ return null;
+ }
+
+ @Override
+ public String getServiceEndpoint()
+ {
+ return null;
+ }
+
+ /**
+ * Get the messaging type
+ *
+ * @return the message type
+ */
+ public String getMessagingType()
+ {
+ return getOverridenDelegate().getMessagingType();
+ }
+
+ /**
+ * Is this JMS
+ *
+ * @return true for jms
+ */
+ public boolean isJMSMessagingType()
+ {
+ return getOverridenDelegate().isJMS();
+ }
+
+ /**
+ * Get the destination type
+ *
+ * @return the destination type
+ */
+ public String getDestinationType()
+ {
+ return getOverridenDelegate().getMessageDestinationType();
+ }
+
+ /**
+ * Get the destination link
+ *
+ * @return the destination link
+ */
+ public String getDestinationLink()
+ {
+ return getOverridenDelegate().getMessageDestinationLink();
+ }
+
+ /**
+ * Get all the activation config properties
+ *
+ * @return a collection of ActivationConfigPropertyMetaData elements
+ */
+ public HashMap<String, ActivationConfigPropertyMetaData> getActivationConfigProperties()
+ {
+ HashMap<String, ActivationConfigPropertyMetaData> result = new LinkedHashMap<String, ActivationConfigPropertyMetaData>();
+ ActivationConfigMetaData config = getOverridenDelegate().getActivationConfig();
+ if (config != null)
+ {
+ ActivationConfigPropertiesMetaData properties = config.getActivationConfigProperties();
+ if (properties != null)
+ {
+ for (org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData property : properties)
+ result.put(property.getName(), new ActivationConfigPropertyMetaData(property));
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Get a particular activation config property
+ *
+ * @param name the name of the property
+ * @return the ActivationConfigPropertyMetaData or null if not found
+ */
+ public ActivationConfigPropertyMetaData getActivationConfigProperty(String name)
+ {
+ ActivationConfigMetaData config = getOverridenDelegate().getActivationConfig();
+ if (config != null)
+ {
+ ActivationConfigPropertiesMetaData properties = config.getActivationConfigProperties();
+ if (properties != null)
+ {
+ org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData result = properties.get(name);
+ if (result != null)
+ return new ActivationConfigPropertyMetaData(result);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Check MDB methods TX type, is cached here
+ *
+ * @return the transaction type
+ */
+ public byte getMethodTransactionType()
+ {
+ if (methodTransactionType == TX_UNSET)
+ {
+ Class[] sig = { Message.class };
+ methodTransactionType = getMethodTransactionType("onMessage", sig);
+ }
+ return methodTransactionType;
+ }
+
+ /**
+ * Check MDB methods TX type, is cached here
+ *
+ * @param methodName the method name
+ * @param signature the signature
+ * @return the transaction type
+ */
+ public byte getMethodTransactionType(String methodName, Class[] signature)
+ {
+ if (isContainerManagedTx())
+ {
+ if (super.getMethodTransactionType(methodName, signature, null) == TX_NOT_SUPPORTED)
+ return TX_NOT_SUPPORTED;
+ else
+ return TX_REQUIRED;
+ }
+ else
+ return TX_UNKNOWN;
+ }
+
+ @Override
+ public byte getMethodTransactionType(String methodName, Class[] params, InvocationType iface)
+ {
+ // A JMS MDB may only ever have one method
+ if (isJMSMessagingType())
+ return getMethodTransactionType();
+ else
+ return getMethodTransactionType(methodName, params);
+ }
+
+ /**
+ * Get the message acknowledgement mode.
+ *
+ * @return MessageDrivenMetaData.AUTO_ACKNOWLADGE_MODE or
+ * MessageDrivenMetaData.DUPS_OK_AKNOWLEDGE_MODE or
+ * MessageDrivenMetaData.CLIENT_ACKNOWLEDGE_MODE
+ */
+ public int getAcknowledgeMode()
+ {
+ // My interpretation of the EJB and JMS spec leads
+ // me to that CLIENT_ACK is the only possible
+ // solution. A transaction is per session in JMS, and
+ // it is not possible to get access to the transaction.
+ // According to the JMS spec it is possible to
+ // multithread handling of messages (but not session),
+ // but there is NO transaction support for this.
+ // I,e, we can not use the JMS transaction for
+ // message ack: hence we must use manual ack.
+
+ // But for NOT_SUPPORTED this is not true here we
+ // should have AUTO_ACKNOWLEDGE_MODE
+
+ // This is not true for now. For JBossMQ we relly
+ // completely on transaction handling. For JBossMQ, the
+ // ackmode is actually not relevant. We keep it here
+ // anyway, if we find that this is needed for other
+ // JMS provider, or is not good.
+
+ if (getMethodTransactionType() == TX_REQUIRED)
+ {
+ return CLIENT_ACKNOWLEDGE_MODE;
+ }
+ else
+ {
+ // TODO LAST enum for acknowledge mode
+ String ack = getOverridenDelegate().getAcknowledgeMode();
+ if (ack == null || ack.equalsIgnoreCase("Auto-acknowledge") || ack.equalsIgnoreCase("AUTO_ACKNOWLEDGE"))
+ return AUTO_ACKNOWLEDGE_MODE;
+ else if (ack.equalsIgnoreCase("Dups-ok-acknowledge") || ack.equalsIgnoreCase("DUPS_OK_ACKNOWLEDGE"))
+ return DUPS_OK_ACKNOWLEDGE_MODE;
+ throw new IllegalStateException("invalid acknowledge-mode: " + ack);
+ }
+ }
+
+ /**
+ * Get the message selector
+ *
+ * @return the selector
+ */
+ public String getMessageSelector()
+ {
+ return getOverridenDelegate().getMessageSelector();
+ }
+
+ /**
+ * Get the destination jndi name
+ *
+ * @return the jndi name
+ */
+ public String getDestinationJndiName()
+ {
+ return getDelegate().getDestinationJndiName();
+ }
+
+ /**
+ * Get the user
+ *
+ * @return the user
+ */
+ public String getUser()
+ {
+ return getDelegate().getMdbUser();
+ }
+
+ /**
+ * Get the password
+ *
+ * @return the password
+ */
+ public String getPasswd()
+ {
+ return getDelegate().getMdbPassword();
+ }
+
+ /**
+ * Get the client id
+ *
+ * @return the client id
+ */
+ public String getClientId()
+ {
+ return getDelegate().getMdbClientId();
+ }
+
+ /**
+ * Get the subscription id
+ *
+ * @return the subscription id
+ */
+ public String getSubscriptionId()
+ {
+ return getDelegate().getMdbSubscriptionId();
+ }
+
+ /**
+ * Get the subscription durability mode.
+ *
+ * @return MessageDrivenMetaData.DURABLE_SUBSCRIPTION or
+ * MessageDrivenMetaData.NON_DURABLE_SUBSCRIPTION
+ */
+ public byte getSubscriptionDurability()
+ {
+ SubscriptionDurability durability = getOverridenDelegate().getSubscriptionDurability();
+ if (durability == SubscriptionDurability.Durable)
+ return DURABLE_SUBSCRIPTION;
+ else
+ return NON_DURABLE_SUBSCRIPTION;
+ }
+
+ /**
+ * Get the resource adapter name
+ *
+ * @return the resource adapter name or null if none specified
+ */
+ public String getResourceAdapterName()
+ {
+ return getDelegate().getResourceAdapterName();
+ }
+
+ @Override
+ public String getJndiName()
+ {
+ throw new UnsupportedOperationException("Message driven beans are not bound into remote jndi");
+ }
+
+ @Override
+ public boolean isCallByValue()
+ {
+ throw new UnsupportedOperationException("Message driven beans do not have a call by value");
+ }
+
+ @Override
+ public boolean isClustered()
+ {
+ throw new UnsupportedOperationException("Message driven beans are not clustered");
+ }
+
+ @Override
+ public Iterator<SecurityRoleRefMetaData> getSecurityRoleReferences()
+ {
+ throw new UnsupportedOperationException("Message driven beans do not have security role references");
+ }
+
+ @Override
+ public ClusterConfigMetaData getClusterConfigMetaData()
+ {
+ throw new UnsupportedOperationException("Message driven beans do not have clustering configuration");
+ }
+
+ @Override
+ public SecurityIdentityMetaData getEjbTimeoutIdentity()
+ {
+ org.jboss.metadata.ejb.spec.SecurityIdentityMetaData securityIdentity = getDelegate().getEjbTimeoutIdentity();
+ if (securityIdentity != null)
+ return new SecurityIdentityMetaData(securityIdentity);
+ return null;
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/MethodAttributes.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/MethodAttributes.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/MethodAttributes.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,113 @@
+/*
+* 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 org.jboss.metadata.ejb.jboss.MethodAttributeMetaData;
+
+/**
+ *
+ * Provides meta-data for method-attributes
+ * <method-attributes>
+ * <method>
+ * <method-name>get*</method-name>
+ * <read-only>true</read-only>
+ * <idempotent>true</idempotent>
+ * <transaction-timeout>100</tranaction-timeout>
+ * </method>
+ * </method-attributes>
+ *
+ * @author <a href="pete at subx.com">Peter Murray</a>
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 37459 $
+ */
+ at Deprecated
+public class MethodAttributes extends OldMetaData<MethodAttributeMetaData>
+{
+ /** The default methods attributes */
+ public static final MethodAttributes kDefaultMethodAttributes = new MethodAttributes(MethodAttributeMetaData.DEFAULT);
+
+ /**
+ * Create a new MethodAttributesMetaData.
+ *
+ * @param delegate the delegate
+ * @return the metadata
+ * @throws IllegalArgumentException for a null delegate or an unknown delegate
+ */
+ public static MethodAttributes create(org.jboss.metadata.ejb.jboss.MethodAttributeMetaData delegate)
+ {
+ if (delegate == null)
+ throw new IllegalArgumentException("Null delegate");
+ return new MethodAttributes(delegate);
+ }
+
+ /**
+ * Create a new QueryMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public MethodAttributes(org.jboss.metadata.ejb.jboss.MethodAttributeMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Whether this matches the method name
+ *
+ * @param methodName the method name
+ * @return true for a match
+ */
+ public boolean patternMatches(String methodName)
+ {
+ return getDelegate().matches(methodName);
+ }
+
+ /**
+ * Whether it is read only
+ *
+ * @return true for read only
+ */
+ public boolean isReadOnly()
+ {
+ return getDelegate().isReadOnly();
+ }
+
+ /**
+ * Whether this is idempotent
+ *
+ * @return true for idempotent
+ */
+ public boolean isIdempotent()
+ {
+ return getDelegate().isIdempotent();
+ }
+
+ /**
+ * Get the transaction timeout
+ *
+ * @return the transaction timeout
+ */
+ public int getTransactionTimeout()
+ {
+ return getDelegate().getTransactionTimeout();
+ }
+}
\ No newline at end of file
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/MethodMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/MethodMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/MethodMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,344 @@
+/*
+* 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 java.util.Collections;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.jboss.invocation.InvocationType;
+
+/** The combination of the method-permission, container-transaction
+ *
+ * <p>
+ * The method-permission element specifies that one or more security
+ * roles are allowed to invoke one or more enterprise bean methods. The
+ * method-permission element consists of an optional description, a list
+ * of security role names, or an indicator to specify that the methods
+ * are not to be checked for authorization, and a list of method elements.
+ * The security roles used in the method-permission element must be
+ * defined in the security-role element of the deployment descriptor,
+ * and the methods must be methods defined in the enterprise bean's component
+ * and/or home interfaces.
+ * </p>
+ * <p>
+ * The container-transaction element specifies how the container must
+ * manage transaction scopes for the enterprise bean's method invocations.
+ * The element consists of an optional description, a list of
+ * method elements, and a transaction attribute. The transaction
+ * attribute is to be applied to all the specified methods.
+ * </p>
+ *
+ * @param <T> the delegate type
+ * @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini</a>
+ * @author <a href="mailto:Scott.Stark at jboss.org">Scott Stark</a>.
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 37390 $
+ */
+ at Deprecated
+public abstract class MethodMetaData<T> extends OldMetaData<T>
+{
+ /** Not used? */
+ public static final int ANY_METHOD = -1;
+
+ /** The home interface */
+ public static String HOME_TYPE = "Home";
+
+ /** The local home interface */
+ public static String LOCAL_HOME_TYPE = "LocalHome";
+
+ /** The remote interface */
+ public static String REMOTE_TYPE = "Remote";
+
+ /** The local interface */
+ public static String LOCAL_TYPE = "Local";
+
+ /** The service endpoint interface */
+ public static String SERVICE_ENDPOINT_TYPE = "ServiceEndpoint";
+
+ /** The method delegate */
+ private org.jboss.metadata.ejb.spec.MethodMetaData methodDelegate;
+
+ /**
+ * Create a new MethodMetaData.
+ *
+ * @param delegate the delegatre
+ * @param methodDelegate the method delegate
+ * @throws IllegalArgumentException for a null delegate or methodDelegate
+ */
+ protected MethodMetaData(T delegate, org.jboss.metadata.ejb.spec.MethodMetaData methodDelegate)
+ {
+ super(delegate);
+ if (methodDelegate == null)
+ throw new IllegalArgumentException("Null method delegate");
+ this.methodDelegate = methodDelegate;
+ }
+
+ /**
+ * Get the method name
+ *
+ * @return the method name
+ */
+ public String getMethodName()
+ {
+ return methodDelegate.getMethodName();
+ }
+
+ /**
+ * Get the ejb name
+ *
+ * @return the ejb name
+ */
+ public String getEjbName()
+ {
+ return methodDelegate.getEjbName();
+ }
+
+ /**
+ * Whether this is a home method
+ *
+ * @return true when a home method
+ */
+ public boolean isHomeMethod()
+ {
+ return methodDelegate.isHomeMethod();
+ }
+
+ /**
+ * Whether this is a remote method
+ *
+ * @return true when a remote method
+ */
+ public boolean isRemoteMethod()
+ {
+ return methodDelegate.isRemoteMethod();
+ }
+
+ /**
+ * Whether this is a local home method
+ *
+ * @return true when a local home method
+ */
+ public boolean isLocalHomeMethod()
+ {
+ return methodDelegate.isLocalHomeMethod();
+ }
+
+ /**
+ * Whether this is a local method
+ *
+ * @return true when a local method
+ */
+ public boolean isLocalMethod()
+ {
+ return methodDelegate.isLocalMethod();
+ }
+
+ /**
+ * Whether this is a service endpoint method
+ *
+ * @return true when a service endpoint method
+ */
+ public boolean isServiceEndpointMethod()
+ {
+ return methodDelegate.isServiceEndpointMethod();
+ }
+
+ /**
+ * Return the interface type name.
+ *
+ * @return one of "Home", "LocalHome", "Remote", "Local", "ServiceEndpoint",
+ * or null if no interface was specified.
+ */
+ public String getInterfaceType()
+ {
+ String type = null;
+ if (isHomeMethod())
+ type = HOME_TYPE;
+ if (isLocalHomeMethod())
+ type = LOCAL_HOME_TYPE;
+ if (isRemoteMethod())
+ type = REMOTE_TYPE;
+ if (isLocalMethod())
+ type = LOCAL_TYPE;
+ if (isServiceEndpointMethod())
+ type = SERVICE_ENDPOINT_TYPE;
+ return type;
+ }
+
+ /**
+ * Whether the method is unchecked
+ *
+ * @return true for unchecked
+ */
+ public boolean isUnchecked()
+ {
+ throw new UnsupportedOperationException("isUnchecked for " + getClass().getName());
+ }
+
+ /**
+ * Whether the method is excluded
+ *
+ * @return true for excluded
+ */
+ public boolean isExcluded()
+ {
+ throw new UnsupportedOperationException("isExcluded for " + getClass().getName());
+ }
+
+ /**
+ * Whether the interface was given
+ *
+ * @return true when the interface was specified
+ */
+ public boolean isIntfGiven()
+ {
+ return methodDelegate.getMethodIntf() != null;
+ }
+
+ /**
+ * Whether the parameters were given
+ *
+ * @return true when the parameters were given
+ */
+ public boolean isParamGiven()
+ {
+ return methodDelegate.getMethodParams() != null;
+ }
+
+ /**
+ * The method param type names.
+ *
+ * @return the parameter types
+ */
+ public Iterator<String> getParams()
+ {
+ Set<String> params = methodDelegate.getMethodParams();
+ if (params == null)
+ params = Collections.emptySet();
+ return params.iterator();
+ }
+
+ /**
+ * The method parameters
+ *
+ * @return An array of the method parameter type names
+ */
+ public String[] getMethodParams()
+ {
+ Set<String> params = methodDelegate.getMethodParams();
+ if (params == null)
+ params = Collections.emptySet();
+ return params.toArray(new String[params.size()]);
+ }
+
+ /**
+ * Get the transaction type
+ *
+ * @return the transaction type
+ */
+ public byte getTransactionType()
+ {
+ throw new UnsupportedOperationException("getTransactionType for " + getClass().getName());
+ }
+
+ /**
+ * Get the roles
+ *
+ * @return the roles
+ */
+ public Set<String> getRoles()
+ {
+ throw new UnsupportedOperationException("getRoles for " + getClass().getName());
+ }
+
+ /**
+ * Get whether the pattern matches
+ *
+ * @param name the method name
+ * @param arg the method args
+ * @param iface the interface type
+ * @return true when it matches
+ */
+ public boolean patternMatches(String name, Class[] arg, InvocationType iface)
+ {
+ return patternMatches(name, getParametersAsStrings(arg), iface);
+ }
+
+ /**
+ * Get whether the pattern matches
+ *
+ * @param name the method name
+ * @param arg the method args
+ * @param iface the interface type
+ * @return true when it matches
+ */
+ public boolean patternMatches(String name, String[] arg, InvocationType iface)
+ {
+ return methodDelegate.matches(name, arg, BeanMetaData.invocationTypeToMethodInterfaceType(iface));
+ }
+ /**
+ * Get string names of classes
+ *
+ * @param classes the classes
+ * @return the string names
+ */
+ private String[] getParametersAsStrings(Class[] classes)
+ {
+ if (classes == null)
+ return null;
+
+ String out[] = new String[classes.length];
+ for (int i = 0; i < out.length; i++)
+ {
+ String brackets = "";
+ Class cls = classes[i];
+ while (cls.isArray())
+ {
+ brackets += "[]";
+ cls = cls.getComponentType();
+ }
+ out[i] = cls.getName() + brackets;
+ }
+ return out;
+ }
+
+ public void setRoles(Set perm)
+ {
+ throw new UnsupportedOperationException("setRoles");
+ }
+
+ public void setUnchecked()
+ {
+ throw new UnsupportedOperationException("setUnchecked");
+ }
+
+ public void setExcluded()
+ {
+ throw new UnsupportedOperationException("setExcluded");
+ }
+
+ public void setTransactionType(byte type)
+ {
+ throw new UnsupportedOperationException("setTransactionType");
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/OldMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/OldMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/OldMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,135 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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 org.jboss.deployment.DeploymentException;
+import org.jboss.metadata.spi.MetaData;
+import org.w3c.dom.Element;
+
+/**
+ * OldMetaData.
+ *
+ * @param <T> the delegate type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Deprecated
+public class OldMetaData<T> extends org.jboss.metadata.MetaData
+{
+ /** The meta data */
+ private MetaData metaData;
+
+ /** The delegate */
+ private T delegate;
+
+ /**
+ * Create a new OldMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public OldMetaData(T delegate)
+ {
+ if (delegate == null)
+ throw new IllegalArgumentException("Null delegate");
+ this.delegate = delegate;
+ }
+
+ /**
+ * Create a new OldMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @param type the delegate type
+ * @throws IllegalArgumentException for a null metaData or type
+ * @throws IllegalStateException if the metadata doesn't have a T
+ */
+ public OldMetaData(MetaData metaData, Class<T> type)
+ {
+ if (metaData == null)
+ throw new IllegalArgumentException("Null metaData");
+ if (type == null)
+ throw new IllegalArgumentException("Null type");
+
+ this.metaData = metaData;
+
+ delegate = metaData.getMetaData(type);
+ if (delegate == null)
+ throw new IllegalStateException(type.getName() + " not found in " + metaData);
+ }
+
+ /**
+ * Get the delegate.
+ *
+ * @return the delegate.
+ */
+ protected T getDelegate()
+ {
+ return delegate;
+ }
+
+ /**
+ * Get the metaData.
+ *
+ * @return the metaData.
+ */
+ protected MetaData getMetaData()
+ {
+ if (metaData == null)
+ throw new IllegalStateException("MetaData has not been set: " + this);
+ return metaData;
+ }
+
+ @Override
+ public String toString()
+ {
+ return super.toString() + "{" + getDelegate() + "}";
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null || obj instanceof OldMetaData == false)
+ return false;
+ OldMetaData other = (OldMetaData) obj;
+ return getDelegate().equals(other.getDelegate());
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return getDelegate().hashCode();
+ }
+
+ @Override
+ public void importEjbJarXml(Element element) throws DeploymentException
+ {
+ throw new UnsupportedOperationException("importEjbJarXml");
+ }
+
+ @Override
+ public void importJbossXml(Element element) throws DeploymentException
+ {
+ throw new UnsupportedOperationException("importJbossXml");
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/OldMetaDataIterator.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/OldMetaDataIterator.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/OldMetaDataIterator.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,92 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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 java.lang.reflect.Method;
+import java.util.Collections;
+import java.util.Iterator;
+
+
+/**
+ * OldMetaDataIterator.
+ *
+ * @param <N> the new type
+ * @param <O> the old type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Deprecated
+public class OldMetaDataIterator<N, O extends OldMetaData<N>> implements Iterator<O>
+{
+ /** The delegate */
+ private Iterator<? extends N> delegate;
+
+ /** The factory method */
+ private Method create;
+
+ /**
+ * Create a new OldMetaDataIterator.
+ *
+ * @param collection the new Collection
+ * @param newClass the new class
+ * @param oldClass the old class
+ */
+ public OldMetaDataIterator(Iterable<? extends N> collection, Class<N> newClass, Class<O> oldClass)
+ {
+ if (collection == null)
+ collection = Collections.emptyList();
+ delegate = collection.iterator();
+
+ try
+ {
+ create = oldClass.getMethod("create", new Class[] { newClass });
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Unable to find factory method: " + oldClass.getName() + ".create(" + newClass.getName() + ")");
+ }
+ }
+
+ public boolean hasNext()
+ {
+ return delegate.hasNext();
+ }
+
+ @SuppressWarnings("unchecked")
+ public O next()
+ {
+ N next = delegate.next();
+ try
+ {
+ return (O) create.invoke(null, new Object[] { next });
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Error invoking factory method: " + create, e);
+ }
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException("remove");
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/OldMetaDataWithOverride.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/OldMetaDataWithOverride.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/OldMetaDataWithOverride.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,75 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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 org.jboss.metadata.javaee.support.OverrideMetaData;
+import org.jboss.metadata.spi.MetaData;
+
+/**
+ * OldMetaDataWithOverride.
+ *
+ * @param <T> the delegate type
+ * @param <O> the overriden metadata
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class OldMetaDataWithOverride<T extends OverrideMetaData<O>, O> extends OldMetaData<T>
+{
+ /** The overriden delegate */
+ private O overridenDelegate;
+
+ /**
+ * Create a new OldMetaDataWithOverride.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public OldMetaDataWithOverride(T delegate)
+ {
+ super(delegate);
+ this.overridenDelegate = delegate.getOverridenMetaData();
+ }
+
+ /**
+ * Create a new OldMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @param type the delegate type
+ * @throws IllegalArgumentException for a null metaData or type
+ * @throws IllegalStateException if the metadata doesn't have a T
+ */
+ public OldMetaDataWithOverride(MetaData metaData, Class<T> type)
+ {
+ super(metaData, type);
+ this.overridenDelegate = getDelegate().getOverridenMetaData();
+ }
+
+ /**
+ * Get the overriden delegate.
+ *
+ * @return the delegate.
+ */
+ protected O getOverridenDelegate()
+ {
+ return overridenDelegate;
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/PermissionMethodMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/PermissionMethodMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/PermissionMethodMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,62 @@
+/*
+* 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 java.util.Collections;
+import java.util.Set;
+
+import org.jboss.metadata.ejb.spec.MethodPermissionMetaData;
+
+/**
+ * PermissionMethodMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Deprecated
+class PermissionMethodMetaData extends MethodMetaData<MethodPermissionMetaData>
+{
+ /**
+ * Create a new PermissionMethodMetaData.
+ *
+ * @param delegate the delegatre
+ * @param methodDelegate the method delegate
+ * @throws IllegalArgumentException for a null delegate or methodDelegate
+ */
+ public PermissionMethodMetaData(MethodPermissionMetaData delegate, org.jboss.metadata.ejb.spec.MethodMetaData methodDelegate)
+ {
+ super(delegate, methodDelegate);
+ }
+
+ public Set<String> getRoles()
+ {
+ Set<String> result = getDelegate().getRoles();
+ if (result == null)
+ result = Collections.emptySet();
+ return result;
+ }
+
+ public boolean isUnchecked()
+ {
+ return getDelegate().isNotChecked();
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/PermissionMethodMetaDataIterator.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/PermissionMethodMetaDataIterator.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/PermissionMethodMetaDataIterator.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,102 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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 java.util.Iterator;
+import java.util.NoSuchElementException;
+
+import org.jboss.metadata.ejb.spec.MethodPermissionMetaData;
+import org.jboss.metadata.ejb.spec.MethodPermissionsMetaData;
+import org.jboss.metadata.ejb.spec.MethodsMetaData;
+
+/**
+ * PermissionMethodMetaDataIterator.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Deprecated
+class PermissionMethodMetaDataIterator implements Iterator<MethodMetaData>
+{
+ /** The delegate */
+ private Iterator<MethodPermissionMetaData> delegate;
+
+ /** The current method permission */
+ private MethodPermissionMetaData permission;
+
+ /** The methods */
+ private Iterator<org.jboss.metadata.ejb.spec.MethodMetaData> methods;
+
+ /**
+ * Create a new PermissionMethod iterator
+ *
+ * @param permissions the permissions
+ */
+ public PermissionMethodMetaDataIterator(MethodPermissionsMetaData permissions)
+ {
+ if (permissions == null)
+ return;
+ delegate = permissions.iterator();
+ bump();
+ }
+
+ public boolean hasNext()
+ {
+ if (delegate == null || methods == null)
+ return false;
+ return methods.hasNext();
+ }
+
+ public MethodMetaData next()
+ {
+ if (delegate == null || methods == null)
+ throw new NoSuchElementException("No next");
+
+ org.jboss.metadata.ejb.spec.MethodMetaData theMethod = methods.next();
+ PermissionMethodMetaData result = new PermissionMethodMetaData(permission, theMethod);
+ if (methods.hasNext() == false)
+ bump();
+ return result;
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException("remove");
+ }
+
+ /**
+ * Bump the iterators onto the next element
+ */
+ private void bump()
+ {
+ while (delegate.hasNext())
+ {
+ permission = delegate.next();
+ MethodsMetaData theMethods = permission.getMethods();
+ if (theMethods != null && theMethods.isEmpty() == false)
+ {
+ methods = theMethods.iterator();
+ break;
+ }
+ }
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/QueryMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/QueryMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/QueryMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,139 @@
+/*
+ * 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 java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.metadata.ejb.spec.MethodParametersMetaData;
+import org.jboss.metadata.spi.MetaData;
+import org.jboss.util.NotImplementedException;
+
+/**
+ * Contains information about ejb-ql queries.
+ *
+ * @author <a href="mailto:dain at daingroup.com">Dain Sundstrom</a>
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 37459 $
+ */
+ at Deprecated
+public class QueryMetaData extends OldMetaData<org.jboss.metadata.ejb.spec.QueryMetaData>
+{
+ /** Remote */
+ public final static String REMOTE = "Remote";
+
+ /** Local */
+ public final static String LOCAL = "Local";
+
+ /**
+ * Create a new QueryMetaData.
+ *
+ * @param delegate the delegate
+ * @return the metadata
+ * @throws IllegalArgumentException for a null delegate or an unknown delegate
+ */
+ public static QueryMetaData create(org.jboss.metadata.ejb.spec.QueryMetaData delegate)
+ {
+ if (delegate == null)
+ throw new IllegalArgumentException("Null delegate");
+ return new QueryMetaData(delegate);
+ }
+
+ /**
+ * Create a new QueryMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public QueryMetaData(org.jboss.metadata.ejb.spec.QueryMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new QueryMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link org.jboss.metadata.ejb.spec.QueryMetaData}
+ */
+ protected QueryMetaData(MetaData metaData)
+ {
+ super(metaData, org.jboss.metadata.ejb.spec.QueryMetaData.class);
+ }
+
+ /**
+ * Gets the user description of the query.
+ *
+ * @return the users description of the query
+ */
+ public String getDescription()
+ {
+ throw new NotImplementedException("getDescription");
+ }
+
+ /**
+ * Gets the name of the query for which this metadata applies.
+ *
+ * @return the name of the query method
+ */
+ public String getMethodName()
+ {
+ return getDelegate().getQueryMethod().getMethodName();
+ }
+
+ /**
+ * Gets an iterator over the parameters of the query method.
+ *
+ * @return an iterator over the parameters of the query method.
+ */
+ public Iterator<String> getMethodParams()
+ {
+ MethodParametersMetaData result = getDelegate().getQueryMethod().getMethodParams();
+ if (result != null)
+ return result.iterator();
+ List<String> list = Collections.emptyList();
+ return list.iterator();
+ }
+
+ /**
+ * Gets the interface type of returned ejb objects. This will be
+ * Local or Remote, and the default is Local.
+ *
+ * @return the type the the interface returned for ejb objects
+ */
+ public String getResultTypeMapping()
+ {
+ return getDelegate().getResultTypeMapping().name();
+ }
+
+ /**
+ * Gets the ejb-ql for this query.
+ *
+ * @return the ejb-ql for this query
+ */
+ public String getEjbQl()
+ {
+ return getDelegate().getEjbQL();
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/RelationMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/RelationMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/RelationMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,122 @@
+/*
+ * 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 org.jboss.metadata.ejb.spec.RelationRoleMetaData;
+import org.jboss.metadata.spi.MetaData;
+
+/**
+ * Represents one ejb-relation element found in the ejb-jar.xml
+ * file's relationships elements.
+ *
+ * @author <a href="mailto:dain at daingroup.com">Dain Sundstrom</a>
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 37390 $
+ */
+ at Deprecated
+public class RelationMetaData extends OldMetaData<org.jboss.metadata.ejb.spec.RelationMetaData>
+{
+ /**
+ * Create a new RelationMetaData.
+ *
+ * @param delegate the delegate
+ * @return the metadata
+ * @throws IllegalArgumentException for a null delegate or an unknown delegate
+ */
+ public static RelationMetaData create(org.jboss.metadata.ejb.spec.RelationMetaData delegate)
+ {
+ if (delegate == null)
+ throw new IllegalArgumentException("Null delegate");
+ return new RelationMetaData(delegate);
+ }
+
+ /**
+ * Create a new RelationMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public RelationMetaData(org.jboss.metadata.ejb.spec.RelationMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new RelationMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link org.jboss.metadata.ejb.spec.RelationMetaData}
+ */
+ protected RelationMetaData(MetaData metaData)
+ {
+ super(metaData, org.jboss.metadata.ejb.spec.RelationMetaData.class);
+ }
+
+ /**
+ * Gets the relation name.
+ * Relation name is loaded from the ejb-relation-name element.
+ *
+ * @return the relation name
+ */
+ public String getRelationName()
+ {
+ return getDelegate().getEjbRelationName();
+ }
+
+ /**
+ * Gets the left relationship role.
+ * The relationship role is loaded from an ejb-relationship-role.
+ * Left/right assignment is completely arbitrary.
+ *
+ * @return the left role
+ */
+ public RelationshipRoleMetaData getLeftRelationshipRole()
+ {
+ return new RelationshipRoleMetaData(getDelegate().getLeftRole());
+ }
+
+ /**
+ * Gets the right relationship role.
+ * The relationship role is loaded from an ejb-relationship-role.
+ * Left/right assignment is completely arbitrary.
+ *
+ * @return the right role
+ */
+ public RelationshipRoleMetaData getRightRelationshipRole()
+ {
+ return new RelationshipRoleMetaData(getDelegate().getRightRole());
+ }
+
+ /**
+ * Get the related role
+ *
+ * @param role the reference role
+ * @return the related role
+ * @throws IllegalArgumentException if the reference role is not a role in this relationship
+ */
+ public RelationshipRoleMetaData getOtherRelationshipRole(RelationshipRoleMetaData role)
+ {
+ RelationRoleMetaData delegateRole = role.getDelegate();
+ return new RelationshipRoleMetaData(getDelegate().getRelatedRole(delegateRole));
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/RelationshipRoleMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/RelationshipRoleMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/RelationshipRoleMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,150 @@
+/*
+ * 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 org.jboss.metadata.ejb.spec.RelationRoleMetaData;
+import org.jboss.metadata.spi.MetaData;
+
+/**
+ * Represents one ejb-relationship-role element found in the ejb-jar.xml
+ * file's ejb-relation elements.
+ *
+ * @author <a href="mailto:dain at daingroup.com">Dain Sundstrom</a>
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 37390 $
+ */
+ at Deprecated
+public class RelationshipRoleMetaData extends OldMetaData<RelationRoleMetaData>
+{
+ /**
+ * Create a new RelationshipeRoleMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public RelationshipRoleMetaData(RelationRoleMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new RelationshipRoleMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link org.jboss.metadata.ejb.spec.RelationRoleMetaData}
+ */
+ protected RelationshipRoleMetaData(MetaData metaData)
+ {
+ super(metaData, RelationRoleMetaData.class);
+ }
+
+ /**
+ * Gets the relationship role name
+ *
+ * @return the role name
+ */
+ public String getRelationshipRoleName()
+ {
+ return getDelegate().getEjbRelationshipRoleName();
+ }
+
+ /**
+ * Gets the relation meta data to which the role belongs.
+ *
+ * @return the relation to which the relationship role belongs
+ */
+ public RelationMetaData getRelationMetaData()
+ {
+ return new RelationMetaData(getDelegate().getRelation());
+ }
+
+ /**
+ * Gets the related role's metadata
+ *
+ * @return the related role
+ */
+ public RelationshipRoleMetaData getRelatedRoleMetaData()
+ {
+ return new RelationshipRoleMetaData(getDelegate().getRelatedRole());
+ }
+
+ /**
+ * Checks if the multiplicity is one.
+ *
+ * @return true when it is one
+ */
+ public boolean isMultiplicityOne()
+ {
+ return getDelegate().isMultiplicityOne();
+ }
+
+ /**
+ * Checks if the multiplicity is many.
+ *
+ * @return true when multiplicity many
+ */
+ public boolean isMultiplicityMany()
+ {
+ return getDelegate().isMultiplicityMany();
+ }
+
+ /**
+ * Should this entity be deleted when related entity is deleted.
+ *
+ * @return true when cascaded delete
+ */
+ public boolean isCascadeDelete()
+ {
+ return getDelegate().isCascadedDelete();
+ }
+
+ /**
+ * Gets the name of the entity that has this role.
+ *
+ * @return the name
+ */
+ public String getEntityName()
+ {
+ return getDelegate().getRoleSource().getEjbName();
+ }
+
+ /**
+ * Gets the name of the entity's cmr field for this role.
+ *
+ * @return the cmr field
+ */
+ public String getCMRFieldName()
+ {
+ return getDelegate().getCmrField().getCmrFieldName();
+ }
+
+ /**
+ * Gets the type of the cmr field (i.e., collection or set)
+ *
+ * @return the field type
+ */
+ public String getCMRFieldType()
+ {
+ return getDelegate().getCmrField().getCmrFieldType();
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/ResourceEnvRefMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ResourceEnvRefMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/ResourceEnvRefMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,114 @@
+/*
+* 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 org.jboss.metadata.javaee.spec.ResourceEnvironmentReferenceMetaData;
+
+/**
+ * The meta data information for a resource-env-ref element.
+ * The resource-env-ref element contains a declaration of an enterprise
+ * bean's reference to an administered object associated with a resource
+ * in the enterprise bean's environment. It consists of an optional
+ * description, the resource environment reference name, and an indication
+ * of the resource environment reference type expected by the enterprise
+ * bean code.
+ * <p/>
+ * Used in: entity, message-driven and session
+ * <p/>
+ * Example:
+ * <resource-env-ref>
+ * <resource-env-ref-name>jms/StockQueue</resource-env-ref-name>
+ * <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
+ * </resource-env-ref>
+ *
+ * @author <a href="mailto:Scott_Stark at displayscape.com">Scott Stark</a>.
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 57300 $
+ */
+ at Deprecated
+public class ResourceEnvRefMetaData extends OldMetaData<ResourceEnvironmentReferenceMetaData>
+{
+ /**
+ * Create a new ResourceEnvRefMetaData.
+ *
+ * @param delegate the delegate
+ * @return the metadata
+ * @throws IllegalArgumentException for a null delegate or an unknown delegate
+ */
+ public static ResourceEnvRefMetaData create(ResourceEnvironmentReferenceMetaData delegate)
+ {
+ if (delegate == null)
+ throw new IllegalArgumentException("Null delegate");
+ return new ResourceEnvRefMetaData(delegate);
+ }
+
+ /**
+ * Create a new ResourceEnvRefMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public ResourceEnvRefMetaData(ResourceEnvironmentReferenceMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Get the jndiName.
+ *
+ * @return the jndiName.
+ */
+ public String getJndiName()
+ {
+ return getDelegate().getMappedName();
+ }
+
+ /**
+ * Get the name.
+ *
+ * @return the name.
+ */
+ public String getName()
+ {
+ return getDelegate().getName();
+ }
+
+ /**
+ * Get the refName.
+ *
+ * @return the refName.
+ */
+ public String getRefName()
+ {
+ return getDelegate().getName();
+ }
+
+ /**
+ * Get the type.
+ *
+ * @return the type.
+ */
+ public String getType()
+ {
+ return getDelegate().getType();
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/ResourceRefMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ResourceRefMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/ResourceRefMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,163 @@
+/*
+* 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 org.jboss.metadata.javaee.spec.ResourceReferenceMetaData;
+
+/**
+ * The meta data information for a resource-ref element.
+ * The resource-ref element contains a declaration of enterprise bean's
+ * reference to an external resource. It consists of an optional description,
+ * the resource manager connection factory reference name, the
+ * indication of the resource manager connection factory type expected
+ * by the enterprise bean code, the type of authentication (Application
+ * or Container), and an optional specification of the shareability of
+ * connections obtained from the resource (Shareable or Unshareable).
+ * Used in: entity, message-driven, and session
+ *
+ * @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini</a>
+ * @author <a href="mailto:Scott.Stark at jboss.org">Scott Stark</a>.
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 57300 $
+ */
+ at Deprecated
+public class ResourceRefMetaData extends OldMetaData<ResourceReferenceMetaData>
+{
+ /**
+ * Create a new ResourceRefMetaData.
+ *
+ * @param delegate the delegate
+ * @return the metadata
+ * @throws IllegalArgumentException for a null delegate or an unknown delegate
+ */
+ public static ResourceRefMetaData create(ResourceReferenceMetaData delegate)
+ {
+ if (delegate == null)
+ throw new IllegalArgumentException("Null delegate");
+ return new ResourceRefMetaData(delegate);
+ }
+
+ /**
+ * Create a new ResourceRefMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public ResourceRefMetaData(ResourceReferenceMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Get the resource name
+ *
+ * @return the resource name
+ */
+ public String getResourceName()
+ {
+ String name = getName();
+ if (name == null)
+ return getRefName();
+ return name;
+ }
+
+ /**
+ * Set ther resource name
+ *
+ * @param resName the resource name
+ * @throws UnsupportedOperationException always
+ */
+ public void setResourceName(String resName)
+ {
+ throw new UnsupportedOperationException("setResourceName");
+ }
+
+ /**
+ * Get the containerAuth.
+ *
+ * @return the containerAuth.
+ */
+ public boolean isContainerAuth()
+ {
+ return getDelegate().isContainerAuth();
+ }
+
+ /**
+ * Get the isShareable.
+ *
+ * @return the isShareable.
+ */
+ public boolean isShareable()
+ {
+ return getDelegate().isShareable();
+ }
+
+ /**
+ * Get the jndiName.
+ *
+ * @return the jndiName.
+ */
+ public String getJndiName()
+ {
+ return getDelegate().getMappedName();
+ }
+
+ /**
+ * Get the name.
+ *
+ * @return the name.
+ */
+ public String getName()
+ {
+ return getDelegate().getName();
+ }
+
+ /**
+ * Get the refName.
+ *
+ * @return the refName.
+ */
+ public String getRefName()
+ {
+ return getDelegate().getName();
+ }
+
+ /**
+ * Get the resURL.
+ *
+ * @return the resURL.
+ */
+ public String getResURL()
+ {
+ return getDelegate().getResUrl();
+ }
+
+ /**
+ * Get the type.
+ *
+ * @return the type.
+ */
+ public String getType()
+ {
+ return getDelegate().getType();
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/SecurityIdentityMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/SecurityIdentityMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/SecurityIdentityMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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 org.jboss.metadata.javaee.spec.DescriptionsImpl;
+import org.jboss.metadata.javaee.spec.RunAsMetaData;
+import org.jboss.metadata.spi.MetaData;
+
+/**
+ * The meta data object for the security-identity element.
+ * The security-identity element specifies whether the caller�s security
+ * identity is to be used for the execution of the methods of the enterprise
+ * bean or whether a specific run-as role is to be used. It
+ * contains an optional description and a specification of the security
+ * identity to be used.
+ * <p/>
+ * Used in: session, entity, message-driven
+ *
+ * @author <a href="mailto:Scott_Stark at displayscape.com">Scott Stark</a>.
+ * @author <a href="mailto:Thomas.Diesler at jboss.org">Thomas Diesler</a>.
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 57209 $
+ */
+ at Deprecated
+public class SecurityIdentityMetaData extends OldMetaData<org.jboss.metadata.ejb.spec.SecurityIdentityMetaData>
+{
+ /**
+ * Create a new SecurityIdentityMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public SecurityIdentityMetaData(org.jboss.metadata.ejb.spec.SecurityIdentityMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new SecurityIdentityMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link org.jboss.metadata.ejb.spec.SecurityIdentityMetaData}
+ */
+ protected SecurityIdentityMetaData(MetaData metaData)
+ {
+ super(metaData, org.jboss.metadata.ejb.spec.SecurityIdentityMetaData.class);
+ }
+
+ /**
+ * Get the description (the first one as per backwards compatibility)
+ *
+ * @return the description
+ */
+ public String getDescription()
+ {
+ DescriptionsImpl descriptions = (DescriptionsImpl) getDelegate().getDescriptions();
+ if (descriptions == null || descriptions.isEmpty())
+ return null;
+ return descriptions.iterator().next().getDescription();
+ }
+
+ /**
+ * Whether to use caller identity
+ *
+ * @return true for caller identity
+ */
+ public boolean getUseCallerIdentity()
+ {
+ return getDelegate().isUseCallerId();
+ }
+
+ public String getRunAsRoleName()
+ {
+ RunAsMetaData runAs = getDelegate().getRunAs();
+ if (runAs == null)
+ return null;
+ return runAs.getRoleName();
+ }
+
+ public String getRunAsPrincipalName()
+ {
+ return getDelegate().getRunAsPrincipal();
+ }
+
+ public void setUseCallerIdentity(boolean flag)
+ {
+ throw new UnsupportedOperationException("setUseCallerIdentity");
+ }
+
+ public void setRunAsRoleName(String runAsRoleName)
+ {
+ throw new UnsupportedOperationException("setRunAsRoleName");
+ }
+
+ public void setRunAsPrincipalName(String principalName)
+ {
+ throw new UnsupportedOperationException("setRunAsPrincipalName");
+ }
+}
Modified: projects/metadata/trunk/src/main/java/org/jboss/metadata/SecurityRoleRefMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/SecurityRoleRefMetaData.java 2007-09-16 14:12:15 UTC (rev 65432)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/SecurityRoleRefMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -1,8 +1,8 @@
/*
- * 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.
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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
@@ -21,83 +21,89 @@
*/
package org.jboss.metadata;
-import java.io.Serializable;
+import org.jboss.metadata.javaee.spec.DescriptionsImpl;
-import org.w3c.dom.Element;
-
/**
- * The metadata object for the security-role-ref element. The security-role-ref
- * element contains the declaration of a security role reference in the
- * enterprise bean�s code. The declaration con-sists of an optional description,
- * the security role name used in the code, and an optional link to a defined
- * security role. The value of the role-name element must be the String used as
- * the parameter to the EJBContext.isCallerInRole(String roleName) method. The
- * value of the role-link element must be the name of one of the security roles
- * defined in the security-role elements.
- *
- * Used in: entity and session
- *
+ * The metadata object for the security-role-ref element.
+ * The security-role-ref element contains the declaration of a security
+ * role reference in the enterprise bean's code. The declaration con-sists
+ * of an optional description, the security role name used in the
+ * code, and an optional link to a defined security role.
+ * The value of the role-name element must be the String used as the
+ * parameter to the EJBContext.isCallerInRole(String roleName) method.
+ * The value of the role-link element must be the name of one of the
+ * security roles defined in the security-role elements.
+ *
* @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini</a>
- * @author Scott.Stark at jboss.org
+ * @author <a href="mailto:Scott_Stark at displayscape.com">Scott Stark</a>.
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
* @version $Revision$
*/
-public class SecurityRoleRefMetaData extends MetaData
- implements Serializable
+public class SecurityRoleRefMetaData extends OldMetaData<org.jboss.metadata.javaee.spec.SecurityRoleRefMetaData>
{
- private static final long serialVersionUID = 1;
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
- private String name;
-
- private String link;
-
- private String description;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
- public SecurityRoleRefMetaData()
+ /**
+ * Create a new SecurityRoleRefMetaData.
+ *
+ * @param delegate the delegate
+ * @return the metadata
+ * @throws IllegalArgumentException for a null delegate or an unknown delegate
+ */
+ public static SecurityRoleRefMetaData create(org.jboss.metadata.javaee.spec.SecurityRoleRefMetaData delegate)
{
+ if (delegate == null)
+ throw new IllegalArgumentException("Null delegate");
+ return new SecurityRoleRefMetaData(delegate);
}
- // Public --------------------------------------------------------
-
- public String getDescription()
+ /**
+ * Create a new ResourceRefMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public SecurityRoleRefMetaData(org.jboss.metadata.javaee.spec.SecurityRoleRefMetaData delegate)
{
- return description;
+ super(delegate);
}
- public void setDescription(String description)
+ /**
+ * Get the name
+ *
+ * @return the name
+ */
+ public String getName()
{
- this.description = description;
+ return getDelegate().getRoleName();
}
+ /**
+ * Get the link
+ *
+ * @return the link
+ */
public String getLink()
{
- return link;
+ return getDelegate().getRoleLink();
}
- public void setLink(String link)
+ /**
+ * Get the description
+ *
+ * @return the description
+ */
+ public String getDescription()
{
- this.link = link;
+ DescriptionsImpl descriptions = (DescriptionsImpl) getDelegate().getDescriptions();
+ if (descriptions == null || descriptions.isEmpty())
+ return null;
+ return descriptions.iterator().next().getDescription();
}
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
+/*
public void importEjbJarXml(Element element)
{
name = getElementContent(getUniqueChild(element, "role-name"));
link = getElementContent(getOptionalChild(element, "role-link"));
description = getElementContent(getOptionalChild(element, "description"));
}
-
+ */
}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/SessionMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/SessionMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/SessionMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,182 @@
+/*
+* 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 java.util.Iterator;
+
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
+import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.spec.SessionBeanMetaData;
+import org.jboss.metadata.javaee.spec.SecurityRoleRefsMetaData;
+import org.jboss.metadata.spi.MetaData;
+
+/**
+ * The meta data information specific to session beans.
+ *
+ * @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini</a>
+ * @author Scott.Stark at jboss.org
+ * @author <a href="mailto:Christoph.Jung at infor.de">Christoph G. Jung</a>.
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 42468 $
+ */
+ at Deprecated
+public class SessionMetaData extends BeanMetaData
+{
+ /** The default stateful invoker */
+ public static final String DEFAULT_STATEFUL_INVOKER = "stateful-unified-invoker";
+
+ /** The default clustered stateful invoker */
+ public static final String DEFAULT_CLUSTERED_STATEFUL_INVOKER = "clustered-stateful-rmi-invoker";
+
+ /** The default stateless invoker */
+ public static final String DEFAULT_STATELESS_INVOKER = "stateless-unified-invoker";
+
+ /** The default clustered stateless invoker */
+ public static final String DEFAULT_CLUSTERED_STATELESS_INVOKER = "clustered-stateless-rmi-invoker";
+
+ /**
+ * Create a new SessionBeanMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ protected SessionMetaData(JBossEnterpriseBeanMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new SessionMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link EnterpriseBeanMetaData}
+ */
+ protected SessionMetaData(MetaData metaData)
+ {
+ super(metaData);
+ }
+
+ @Override
+ public JBossSessionBeanMetaData getDelegate()
+ {
+ return (JBossSessionBeanMetaData) super.getDelegate();
+ }
+
+ @Override
+ public SessionBeanMetaData getOverridenDelegate()
+ {
+ return (SessionBeanMetaData) super.getOverridenDelegate();
+ }
+
+ @Override
+ public String getHome()
+ {
+ return getOverridenDelegate().getHome();
+ }
+
+ @Override
+ public String getLocal()
+ {
+ return getOverridenDelegate().getLocal();
+ }
+
+ @Override
+ public String getLocalHome()
+ {
+ return getOverridenDelegate().getLocalHome();
+ }
+
+ @Override
+ public String getRemote()
+ {
+ return getOverridenDelegate().getRemote();
+ }
+
+ @Override
+ public String getServiceEndpoint()
+ {
+ return getOverridenDelegate().getServiceEndpoint();
+ }
+
+ /**
+ * Whether it is stateful
+ *
+ * @return true when stateful
+ */
+ public boolean isStateful()
+ {
+ return getOverridenDelegate().isStateful();
+ }
+
+ /**
+ * Whether it is stateless
+ *
+ * @return true when stateless
+ */
+ public boolean isStateless()
+ {
+ return getOverridenDelegate().isStateless();
+ }
+
+ @Override
+ public String getJndiName()
+ {
+ return getDelegate().determineJndiName();
+ }
+
+ @Override
+ public boolean isCallByValue()
+ {
+ return getDelegate().isCallByValue();
+ }
+
+ @Override
+ public boolean isClustered()
+ {
+ return getDelegate().isClustered();
+ }
+
+ @Override
+ public ClusterConfigMetaData getClusterConfigMetaData()
+ {
+ org.jboss.metadata.ejb.jboss.ClusterConfigMetaData config = getDelegate().determineClusterConfig();
+ return new ClusterConfigMetaData(config);
+ }
+
+ @Override
+ public Iterator<SecurityRoleRefMetaData> getSecurityRoleReferences()
+ {
+ SecurityRoleRefsMetaData roleRefs = getOverridenDelegate().getSecurityRoleRefs();
+ return new OldMetaDataIterator<org.jboss.metadata.javaee.spec.SecurityRoleRefMetaData, SecurityRoleRefMetaData>(roleRefs, org.jboss.metadata.javaee.spec.SecurityRoleRefMetaData.class, SecurityRoleRefMetaData.class);
+ }
+
+ @Override
+ public SecurityIdentityMetaData getEjbTimeoutIdentity()
+ {
+ org.jboss.metadata.ejb.spec.SecurityIdentityMetaData securityIdentity = getDelegate().getEjbTimeoutIdentity();
+ if (securityIdentity != null)
+ return new SecurityIdentityMetaData(securityIdentity);
+ return null;
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/TransactionMethodMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/TransactionMethodMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/TransactionMethodMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,58 @@
+/*
+* 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 org.jboss.metadata.ejb.spec.ContainerTransactionMetaData;
+import org.jboss.metadata.ejb.spec.TransAttributeType;
+
+/**
+ * TransactionMethodMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Deprecated
+class TransactionMethodMetaData extends MethodMetaData<ContainerTransactionMetaData>
+{
+ /**
+ * Create a new TransactionMethodMetaData.
+ *
+ * @param delegate the delegatre
+ * @param methodDelegate the method delegate
+ * @throws IllegalArgumentException for a null delegate or methodDelegate
+ */
+ public TransactionMethodMetaData(ContainerTransactionMetaData delegate, org.jboss.metadata.ejb.spec.MethodMetaData methodDelegate)
+ {
+ super(delegate, methodDelegate);
+ }
+
+ /**
+ * Get the transaction type
+ *
+ * @return the transaction type
+ */
+ public byte getTransactionType()
+ {
+ TransAttributeType attribute = getDelegate().getTransAttribute();
+ return BeanMetaData.mapTransactionType(attribute);
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/TransactionMethodMetaDataIterator.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/TransactionMethodMetaDataIterator.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/TransactionMethodMetaDataIterator.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,102 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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 java.util.Iterator;
+import java.util.NoSuchElementException;
+
+import org.jboss.metadata.ejb.spec.ContainerTransactionMetaData;
+import org.jboss.metadata.ejb.spec.ContainerTransactionsMetaData;
+import org.jboss.metadata.ejb.spec.MethodsMetaData;
+
+/**
+ * TransactionMethodMetaDataIterator.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at Deprecated
+class TransactionMethodMetaDataIterator implements Iterator<MethodMetaData>
+{
+ /** The delegate */
+ private Iterator<ContainerTransactionMetaData> delegate;
+
+ /** The current container transaction */
+ private ContainerTransactionMetaData transaction;
+
+ /** The methods */
+ private Iterator<org.jboss.metadata.ejb.spec.MethodMetaData> methods;
+
+ /**
+ * Create a new TransactionMethod iterator
+ *
+ * @param transactions the transactions
+ */
+ public TransactionMethodMetaDataIterator(ContainerTransactionsMetaData transactions)
+ {
+ if (transactions == null)
+ return;
+ delegate = transactions.iterator();
+ bump();
+ }
+
+ public boolean hasNext()
+ {
+ if (delegate == null || methods == null)
+ return false;
+ return methods.hasNext();
+ }
+
+ public MethodMetaData next()
+ {
+ if (delegate == null || methods == null)
+ throw new NoSuchElementException("No next");
+
+ org.jboss.metadata.ejb.spec.MethodMetaData theMethod = methods.next();
+ TransactionMethodMetaData result = new TransactionMethodMetaData(transaction, theMethod);
+ if (methods.hasNext() == false)
+ bump();
+ return result;
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException("remove");
+ }
+
+ /**
+ * Bump the iterators onto the next element
+ */
+ private void bump()
+ {
+ while (delegate.hasNext())
+ {
+ transaction = delegate.next();
+ MethodsMetaData theMethods = transaction.getMethods();
+ if (theMethods != null && theMethods.isEmpty() == false)
+ {
+ methods = theMethods.iterator();
+ break;
+ }
+ }
+ }
+}
Modified: projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeanMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeanMetaData.java 2007-09-16 14:12:15 UTC (rev 65432)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeanMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -22,6 +22,7 @@
package org.jboss.metadata.ejb.jboss;
import java.lang.reflect.Method;
+import java.security.Principal;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@ -59,6 +60,9 @@
import org.jboss.metadata.javaee.support.AbstractMappedMetaData;
import org.jboss.metadata.javaee.support.NamedMetaDataWithDescriptionGroupWithOverride;
import org.jboss.metadata.javaee.support.NonNullLinkedHashSet;
+import org.jboss.security.AnybodyPrincipal;
+import org.jboss.security.NobodyPrincipal;
+import org.jboss.security.SimplePrincipal;
import org.jboss.xb.annotations.JBossXmlConstants;
import org.jboss.xb.annotations.JBossXmlModelGroup;
@@ -904,9 +908,9 @@
* @param interfaceType the interface type
* @return The Set<Principal> for the application domain roles that caller principal's are to be validated against.
*/
- public Set<String> getMethodPermissions(String methodName, Class[] params, MethodInterfaceType interfaceType)
+ public Set<Principal> getMethodPermissions(String methodName, Class[] params, MethodInterfaceType interfaceType)
{
- Set<String> result = null;
+ Set<Principal> result = null;
EnterpriseBeanMetaData ejb = getOverridenMetaDataWithCheck();
JBossMetaData jbossMetaData = getJBossMetaDataWithCheck();
@@ -921,8 +925,8 @@
// We don't return null to differentiate between an explicit
// assignment of no access and no assignment information.
if (result == null)
- result = new HashSet<String>();
- result.add("NOBODY_PRINCIPAL");
+ result = new HashSet<Principal>();
+ result.add(NobodyPrincipal.NOBODY_PRINCIPAL);
return result;
}
@@ -936,7 +940,7 @@
{
if (result != null)
result.clear();
- result.add("ANYBODY_PRINCIPAL");
+ result.add(AnybodyPrincipal.ANYBODY_PRINCIPAL);
break;
}
else if (permission.matches(methodName, params, interfaceType))
@@ -952,8 +956,8 @@
for (String principal : principals)
{
if (result == null)
- result = new HashSet<String>();
- result.add(principal);
+ result = new HashSet<Principal>();
+ result.add(new SimplePrincipal(principal));
}
}
}
@@ -964,8 +968,8 @@
if (jbossMetaData.isExcludeMissingMethods() == false && result == null)
{
- result = new HashSet<String>();
- result.add("ANYBODY_PRINCIPAL");
+ result = new HashSet<Principal>();
+ result.add(AnybodyPrincipal.ANYBODY_PRINCIPAL);
}
if (result == null)
Added: projects/metadata/trunk/src/main/java/org/jboss/security/AnybodyPrincipal.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/security/AnybodyPrincipal.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/security/AnybodyPrincipal.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,82 @@
+/*
+* 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.security;
+
+import java.security.Principal;
+
+/** An implementation of Principal and Comparable that represents any role.
+Any Principal or name of a Principal when compared to an AnybodyPrincipal
+using {@link #equals(Object) equals} or {@link #compareTo(Object) compareTo}
+will always be found equals to the AnybodyPrincipal.
+
+Note that this class is not likely to operate correctly in a collection
+since the hashCode() and equals() methods are not correlated.
+
+ at author Scott.Stark at jboss.org
+ at version $Revision: 40149 $
+*/
+public class AnybodyPrincipal implements Comparable, Principal
+{
+ public static final String ANYBODY = "<ANYBODY>";
+ public static final AnybodyPrincipal ANYBODY_PRINCIPAL = new AnybodyPrincipal();
+
+ public int hashCode()
+ {
+ return ANYBODY.hashCode();
+ }
+
+ /**
+ @return "<ANYBODY>"
+ */
+ public String getName()
+ {
+ return ANYBODY;
+ }
+
+ public String toString()
+ {
+ return ANYBODY;
+ }
+
+ /** This method always returns 0 to indicate equality for any argument.
+ This is only meaningful when comparing against other Principal objects
+ or names of Principals.
+
+ @return true to indicate equality for any argument.
+ */
+ public boolean equals(Object another)
+ {
+ return true;
+ }
+
+ /** This method always returns 0 to indicate equality for any argument.
+ This is only meaningful when comparing against other Principal objects
+ or names of Principals.
+
+ @return 0 to indicate equality for any argument.
+ */
+ public int compareTo(Object o)
+ {
+ return 0;
+ }
+
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/security/NobodyPrincipal.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/security/NobodyPrincipal.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/security/NobodyPrincipal.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,82 @@
+/*
+* 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.security;
+
+import java.security.Principal;
+
+/** An implementation of Principal and Comparable that represents no role.
+Any Principal or name of a Principal when compared to an NobodyPrincipal
+using {@link #equals(Object) equals} or {@link #compareTo(Object) compareTo}
+will always be found not equal to the NobodyPrincipal.
+
+Note that this class is not likely to operate correctly in a collection
+since the hashCode() and equals() methods are not correlated.
+
+ at author Scott.Stark at jboss.org
+ at version $Revision: 40149 $
+*/
+public class NobodyPrincipal implements Comparable, Principal
+{
+ public static final String NOBODY = "<NOBODY>";
+ public static final NobodyPrincipal NOBODY_PRINCIPAL = new NobodyPrincipal();
+
+ public int hashCode()
+ {
+ return NOBODY.hashCode();
+ }
+
+ /**
+ @return "<NOBODY>"
+ */
+ public String getName()
+ {
+ return NOBODY;
+ }
+
+ public String toString()
+ {
+ return NOBODY;
+ }
+
+ /** This method always returns 0 to indicate equality for any argument.
+ This is only meaningful when comparing against other Principal objects
+ or names of Principals.
+
+ @return false to indicate inequality for any argument.
+ */
+ public boolean equals(Object another)
+ {
+ return false;
+ }
+
+ /** This method always returns 1 to indicate inequality for any argument.
+ This is only meaningful when comparing against other Principal objects
+ or names of Principals.
+
+ @return 1 to indicate inequality for any argument.
+ */
+ public int compareTo(Object o)
+ {
+ return 1;
+ }
+
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/security/SecurityRoleMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/security/SecurityRoleMetaData.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/security/SecurityRoleMetaData.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,108 @@
+/*
+* 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.security;
+
+import java.util.Set;
+
+import org.jboss.metadata.javaee.spec.SecurityRolesMetaData;
+import org.jboss.metadata.OldMetaData;
+import org.jboss.metadata.spi.MetaData;
+
+/**
+ * The meta data object for the security-role-mapping element.
+ *
+ * The security-role-mapping element maps the user principal
+ * to a different principal on the server. It can for example
+ * be used to map a run-as-principal to more than one role.
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 40750 $
+ */
+ at Deprecated
+public class SecurityRoleMetaData extends OldMetaData<org.jboss.metadata.javaee.spec.SecurityRoleMetaData>
+{
+ /**
+ * Create a new SecurityRoleMetaData.
+ *
+ * @param delegate the delegate
+ * @throws IllegalArgumentException for a null delegate
+ */
+ public SecurityRoleMetaData(org.jboss.metadata.javaee.spec.SecurityRoleMetaData delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Create a new SecurityMetaData.
+ *
+ * @param metaData the delegate metadata
+ * @throws IllegalArgumentException for a null metaData
+ * @throws IllegalStateException if the metadata doesn't have an {@link SecurityRolesMetaData}
+ */
+ protected SecurityRoleMetaData(MetaData metaData)
+ {
+ super(metaData, org.jboss.metadata.javaee.spec.SecurityRoleMetaData.class);
+ }
+
+ /**
+ * Get the role name
+ *
+ * @return the role name
+ */
+ public String getRoleName()
+ {
+ return getDelegate().getRoleName();
+ }
+
+ /**
+ * Get the principals
+ *
+ * @return the principals
+ */
+ public Set<String> getPrincipals()
+ {
+ return getDelegate().getPrincipals();
+ }
+
+ /**
+ * Add a principal name
+ *
+ * @param principalName the principal name
+ * @throws UnsupportedOperationException always
+ */
+ public void addPrincipalName(String principalName)
+ {
+ throw new UnsupportedOperationException("addPrincipalName");
+ }
+
+ /**
+ * Add some principal names
+ *
+ * @param principalNames the principal names
+ * @throws UnsupportedOperationException always
+ */
+ public void addPrincipalNames(Set principalNames)
+ {
+ throw new UnsupportedOperationException("addPrincipalNames");
+ }
+}
Added: projects/metadata/trunk/src/main/java/org/jboss/security/SimplePrincipal.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/security/SimplePrincipal.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/security/SimplePrincipal.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -0,0 +1,75 @@
+/*
+* 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.security;
+
+import java.security.Principal;
+
+/**
+ * A simple String based implementation of Principal. Typically a
+ * SimplePrincipal is created given a userID which is used as the Principal
+ * name.
+ * @author <a href="on at ibis.odessa.ua">Oleg Nitz</a>
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 40149 $
+ */
+public class SimplePrincipal implements Principal, java.io.Serializable
+{
+ static final long serialVersionUID = 7701951188631723261L;
+ private String name;
+
+ public SimplePrincipal(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Compare this SimplePrincipal's name against another Principal
+ * @return true if name equals another.getName();
+ */
+ public boolean equals(Object another)
+ {
+ if (!(another instanceof Principal))
+ return false;
+ String anotherName = ((Principal) another).getName();
+ boolean equals = false;
+ if (name == null)
+ equals = anotherName == null;
+ else
+ equals = name.equals(anotherName);
+ return equals;
+ }
+
+ public int hashCode()
+ {
+ return (name == null ? 0 : name.hashCode());
+ }
+
+ public String toString()
+ {
+ return name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+}
Modified: projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/AbstractEJBEverythingTest.java
===================================================================
--- projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/AbstractEJBEverythingTest.java 2007-09-16 14:12:15 UTC (rev 65432)
+++ projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/AbstractEJBEverythingTest.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -22,10 +22,20 @@
package org.jboss.test.metadata.ejb;
import java.util.Iterator;
+import java.util.Map;
import java.util.Set;
+import java.util.Map.Entry;
import junit.framework.AssertionFailedError;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.BeanMetaData;
+import org.jboss.metadata.EntityMetaData;
+import org.jboss.metadata.IorSecurityConfigMetaData;
+import org.jboss.metadata.MessageDrivenMetaData;
+import org.jboss.metadata.MetaData;
+import org.jboss.metadata.RelationshipRoleMetaData;
+import org.jboss.metadata.SessionMetaData;
import org.jboss.metadata.ejb.jboss.CacheInvalidationConfigMetaData;
import org.jboss.metadata.ejb.jboss.ClusterConfigMetaData;
import org.jboss.metadata.ejb.jboss.IORASContextMetaData;
@@ -120,7 +130,7 @@
assertFullMDB("mdb2", enterpriseBeansMetaData);
}
-/* protected void assertEnterpriseBeans(ApplicationMetaData applicationMetaData)
+ protected void assertEnterpriseBeans(ApplicationMetaData applicationMetaData)
{
Iterator<BeanMetaData> i = applicationMetaData.getEnterpriseBeans();
assertNotNull(i);
@@ -150,11 +160,11 @@
assertNullEntity("entity0", applicationMetaData);
assertFullEntity("entity1", applicationMetaData);
assertFullEntity("entity2", applicationMetaData);
- EntityMetaData entity = assertEntity("entity3", applicationMetaData);
+ EntityMetaData entity = assertEntity("entity3EjbName", applicationMetaData);
assertTrue(entity.isBMP());
- entity = assertEntity("entity4", applicationMetaData);
+ entity = assertEntity("entity4EjbName", applicationMetaData);
assertFalse(entity.isReentrant());
- entity = assertEntity("entity5", applicationMetaData);
+ entity = assertEntity("entity5EjbName", applicationMetaData);
assertTrue(entity.isCMP1x());
assertTrue(entity.isCMP1x());
@@ -162,7 +172,7 @@
assertFullMDB("mdb1", applicationMetaData);
assertFullMDB("mdb2", applicationMetaData);
}
-*/
+
protected SessionBeanMetaData assertFullSession(String ejbName, EnterpriseBeansMetaData enterpriseBeansMetaData)
{
throw new NotImplementedException();
@@ -208,7 +218,7 @@
return session;
}
-/* private SessionMetaData assertFullSession(String ejbName, ApplicationMetaData applicationMetaData)
+ private SessionMetaData assertFullSession(String ejbName, ApplicationMetaData applicationMetaData)
{
SessionMetaData session = assertSession(ejbName, applicationMetaData);
assertClass(ejbName, "Home", session.getHome());
@@ -222,15 +232,15 @@
assertEnvironment(ejbName, session, true);
assertMethodAttributes(ejbName, session);
assertContainerTransactions(session.getTransactionMethods());
- assertMethodPermissions(7, session);
+ assertMethodPermissions(ejbName, 7, session);
assertExcludedMethods(ejbName, session.getExcludedMethods());
assertSecurityRoleRefs(ejbName, 2, session.getSecurityRoleReferences());
assertSecurityIdentity(ejbName, "SecurityIdentity", session.getSecurityIdentityMetaData(), true);
return session;
}
-*/
-/* private SessionMetaData assertNullSession(String ejbName, ApplicationMetaData applicationMetaData)
+
+ private SessionMetaData assertNullSession(String ejbName, ApplicationMetaData applicationMetaData)
{
SessionMetaData session = assertSession(ejbName, applicationMetaData);
assertNull(session.getHome());
@@ -251,16 +261,16 @@
return session;
}
-*/
-/* private SessionMetaData assertSession(String ejbName, ApplicationMetaData applicationMetaData)
+
+ private SessionMetaData assertSession(String ejbName, ApplicationMetaData applicationMetaData)
{
- SessionMetaData session = assertEnterpriseBean(ejbName, applicationMetaData, SessionMetaData.class);
+ SessionMetaData session = assertEnterpriseBean(ejbName + "EjbName", applicationMetaData, SessionMetaData.class);
assertTrue(session.isSession());
assertFalse(session.isEntity());
assertFalse(session.isMessageDriven());
return session;
}
-*/
+
protected EntityBeanMetaData assertFullEntity(String ejbName, EnterpriseBeansMetaData enterpriseBeansMetaData)
{
throw new NotImplementedException();
@@ -308,9 +318,9 @@
return entity;
}
-/* private EntityMetaData assertFullEntity(String ejbName, ApplicationMetaData applicationMetaData)
+ private EntityMetaData assertFullEntity(String ejbName, ApplicationMetaData applicationMetaData)
{
- EntityMetaData entity = assertEntity(ejbName, applicationMetaData);
+ EntityMetaData entity = assertEntity(ejbName + "EjbName", applicationMetaData);
assertEquals(ejbName + "Home", entity.getHome());
assertEquals(ejbName + "Remote", entity.getRemote());
assertEquals(ejbName + "LocalHome", entity.getLocalHome());
@@ -326,7 +336,7 @@
assertEquals(ejbName + "PrimKeyField",entity.getPrimKeyField());
assertEnvironment(ejbName, entity, true);
assertMethodAttributes(ejbName, entity);
- assertMethodPermissions(7, entity);
+ assertMethodPermissions(ejbName, 7, entity);
assertExcludedMethods(ejbName, entity.getExcludedMethods());
assertSecurityRoleRefs(ejbName, 2, entity.getSecurityRoleReferences());
assertSecurityIdentity(ejbName, "SecurityIdentity", entity.getSecurityIdentityMetaData(), true);
@@ -334,10 +344,10 @@
return entity;
}
-*/
-/* private EntityMetaData assertNullEntity(String ejbName, ApplicationMetaData applicationMetaData)
+
+ private EntityMetaData assertNullEntity(String ejbName, ApplicationMetaData applicationMetaData)
{
- EntityMetaData entity = assertEntity(ejbName, applicationMetaData);
+ EntityMetaData entity = assertEntity(ejbName + "EjbName", applicationMetaData);
assertNull(entity.getHome());
assertNull(entity.getRemote());
assertNull(entity.getLocalHome());
@@ -361,8 +371,8 @@
return entity;
}
-*/
-/* protected EntityMetaData assertEntity(String ejbName, ApplicationMetaData applicationMetaData)
+
+ protected EntityMetaData assertEntity(String ejbName, ApplicationMetaData applicationMetaData)
{
EntityMetaData entity = assertEnterpriseBean(ejbName, applicationMetaData, EntityMetaData.class);
assertFalse(entity.isSession());
@@ -370,8 +380,8 @@
assertFalse(entity.isMessageDriven());
return entity;
}
-*/
-/* private void assertCmpFields(String ejbName, int size, Iterator<String> cmpFieldsMetaData)
+
+ private void assertCmpFields(String ejbName, int size, Iterator<String> cmpFieldsMetaData)
{
assertNotNull(cmpFieldsMetaData);
int count = 1;
@@ -382,8 +392,8 @@
}
assertEquals(size + 1, count);
}
-*/
-/* private void assertQueries(String ejbName, int size, Iterator<org.jboss.metadata.QueryMetaData> queries)
+
+ private void assertQueries(String ejbName, int size, Iterator<org.jboss.metadata.QueryMetaData> queries)
{
assertNotNull(queries);
int count = 1;
@@ -402,7 +412,7 @@
}
assertEquals(size + 1, count);
}
-*/
+
private void assertMethodParams(String prefix, int size, Iterator<String> params)
{
assertNotNull(params);
@@ -460,9 +470,9 @@
return mdb;
}
-/* protected MessageDrivenMetaData assertFullMDB(String ejbName, ApplicationMetaData applicationMetaData)
+ protected MessageDrivenMetaData assertFullMDB(String ejbName, ApplicationMetaData applicationMetaData)
{
- MessageDrivenMetaData mdb = assertMDB(ejbName, applicationMetaData);
+ MessageDrivenMetaData mdb = assertMDB(ejbName + "EjbName", applicationMetaData);
assertEquals(ejbName + "EjbClass", mdb.getEjbClass());
assertEquals(ejbName + "MessagingType", mdb.getMessagingType());
@@ -472,16 +482,16 @@
assertActivationConfigProperties(ejbName, 2, mdb.getActivationConfigProperties());
assertEnvironment(ejbName, mdb, true);
assertMethodAttributes(ejbName, mdb);
- assertMethodPermissions(7, mdb);
+ assertMethodPermissions(ejbName, 7, mdb);
assertExcludedMethods(ejbName, mdb.getExcludedMethods());
assertSecurityIdentity(ejbName, "SecurityIdentity", mdb.getSecurityIdentityMetaData(), true);
return mdb;
}
-*/
-/* private MessageDrivenMetaData assertNullMDB(String ejbName, ApplicationMetaData applicationMetaData)
+
+ private MessageDrivenMetaData assertNullMDB(String ejbName, ApplicationMetaData applicationMetaData)
{
- MessageDrivenMetaData mdb = assertMDB(ejbName, applicationMetaData);
+ MessageDrivenMetaData mdb = assertMDB(ejbName + "EjbName", applicationMetaData);
assertNull(mdb.getEjbClass());
assertNull(mdb.getMessagingType());
@@ -497,7 +507,7 @@
return mdb;
}
-*/
+
protected void assertActivationConfig(String prefix, ActivationConfigMetaData activationConfigMetaData)
{
assertNotNull(activationConfigMetaData);
@@ -519,7 +529,7 @@
}
}
-/* private void assertActivationConfigProperties(String ejbName, int size, Map<String, org.jboss.metadata.ActivationConfigPropertyMetaData> activationConfigPropertiesMetaData)
+ private void assertActivationConfigProperties(String ejbName, int size, Map<String, org.jboss.metadata.ActivationConfigPropertyMetaData> activationConfigPropertiesMetaData)
{
assertNotNull(activationConfigPropertiesMetaData);
assertEquals(size, activationConfigPropertiesMetaData.size());
@@ -533,8 +543,8 @@
++count;
}
}
-*/
-/* protected MessageDrivenMetaData assertMDB(String ejbName, ApplicationMetaData applicationMetaData)
+
+ protected MessageDrivenMetaData assertMDB(String ejbName, ApplicationMetaData applicationMetaData)
{
MessageDrivenMetaData mdb = assertEnterpriseBean(ejbName, applicationMetaData, MessageDrivenMetaData.class);
assertFalse(mdb.isSession());
@@ -542,7 +552,7 @@
assertTrue(mdb.isMessageDriven());
return mdb;
}
-*/
+
protected <T extends EnterpriseBeanMetaData> T assertEnterpriseBean(String ejbName, EnterpriseBeansMetaData enterpriseBeansMetaData, Class<T> expected)
{
EnterpriseBeanMetaData enterpriseBeanMeta = enterpriseBeansMetaData.get(ejbName);
@@ -551,14 +561,14 @@
return expected.cast(enterpriseBeanMeta);
}
-/* private <T extends BeanMetaData> T assertEnterpriseBean(String ejbName, ApplicationMetaData applicationMetaData, Class<T> expected)
+ private <T extends BeanMetaData> T assertEnterpriseBean(String ejbName, ApplicationMetaData applicationMetaData, Class<T> expected)
{
BeanMetaData beanMeta = applicationMetaData.getBeanByEjbName(ejbName);
assertNotNull(beanMeta);
assertEquals(ejbName, beanMeta.getEjbName());
return expected.cast(beanMeta);
}
-*/
+
protected void assertRelationships(EjbJarMetaData ejbJarMetaData)
{
RelationsMetaData relationsMetaData = ejbJarMetaData.getRelationships();
@@ -624,7 +634,7 @@
assertEquals(prefix + "Type", cmrFieldMetaData.getCmrFieldType());
}
-/* protected void assertRelationships(ApplicationMetaData applicationMetaData)
+ protected void assertRelationships(ApplicationMetaData applicationMetaData)
{
Iterator<org.jboss.metadata.RelationMetaData> i = applicationMetaData.getRelationships();
assertNotNull(i);
@@ -636,8 +646,8 @@
}
assertEquals(3, count);
}
-*/
-/* private void assertRelation(String prefix, org.jboss.metadata.RelationMetaData relationMetaData)
+
+ private void assertRelation(String prefix, org.jboss.metadata.RelationMetaData relationMetaData)
{
assertEquals(prefix + "Name", relationMetaData.getRelationName());
assertRelationRole(prefix + "Role1", false, relationMetaData.getLeftRelationshipRole());
@@ -647,8 +657,8 @@
assertEquals(relationMetaData.getLeftRelationshipRole(), relationMetaData.getRightRelationshipRole().getRelatedRoleMetaData());
assertEquals(relationMetaData.getRightRelationshipRole(), relationMetaData.getLeftRelationshipRole().getRelatedRoleMetaData());
}
-*/
-/* private void assertRelationRole(String prefix, boolean many, RelationshipRoleMetaData relationRoleMetaData)
+
+ private void assertRelationRole(String prefix, boolean many, RelationshipRoleMetaData relationRoleMetaData)
{
assertNotNull(relationRoleMetaData);
assertEquals(prefix + "Name", relationRoleMetaData.getRelationshipRoleName());
@@ -663,11 +673,11 @@
assertTrue(relationRoleMetaData.isMultiplicityOne());
}
assertTrue(relationRoleMetaData.isCascadeDelete());
- assertEquals(prefix + "RoleSourceName", relationRoleMetaData.getEntityName());
+ assertEquals(prefix + "RoleSourceNameEjbName", relationRoleMetaData.getEntityName());
assertEquals(prefix + "CmrFieldName", relationRoleMetaData.getCMRFieldName());
assertEquals(prefix + "CmrFieldType", relationRoleMetaData.getCMRFieldType());
}
-*/
+
protected AssemblyDescriptorMetaData assertAssemblyDescriptor(EjbJarMetaData ejbJarMetaData)
{
AssemblyDescriptorMetaData assemblyDescriptorMetaData = ejbJarMetaData.getAssemblyDescriptor();
@@ -681,7 +691,7 @@
return assemblyDescriptorMetaData;
}
-/* protected void assertAssemblyDescriptor(ApplicationMetaData applicationMetaData)
+ protected void assertAssemblyDescriptor(ApplicationMetaData applicationMetaData)
{
org.jboss.metadata.AssemblyDescriptorMetaData assemblyDescriptorMetaData = applicationMetaData.getAssemblyDescriptor();
assertNotNull(assemblyDescriptorMetaData);
@@ -689,7 +699,7 @@
assertMessageDestination("messageDestination1", assemblyDescriptorMetaData.getMessageDestinationMetaData("messageDestination1Name"));
assertMessageDestination("messageDestination2", assemblyDescriptorMetaData.getMessageDestinationMetaData("messageDestination2Name"));
}
-*/
+
protected void assertMethodPermissions(String ejbName, String prefix, int size, int limit, MethodPermissionsMetaData methodPermissionsMetaData)
{
assertNotNull(methodPermissionsMetaData);
@@ -719,7 +729,7 @@
}
}
-/* private void assertMethodPermissions(int size, BeanMetaData beanMetaData)
+ private void assertMethodPermissions(String nameBase, int size, BeanMetaData beanMetaData)
{
int count = 1;
Iterator<org.jboss.metadata.MethodMetaData> methods = beanMetaData.getPermissionMethods();
@@ -728,11 +738,11 @@
{
String permissionPrefix = null;
if (count <= 5)
- permissionPrefix = beanMetaData.getEjbName() + "MethodPermission1";
+ permissionPrefix = nameBase + "MethodPermission1";
else if (count == 6)
- permissionPrefix = beanMetaData.getEjbName() + "MethodPermission2";
+ permissionPrefix = nameBase + "MethodPermission2";
else if (count == 7)
- permissionPrefix = beanMetaData.getEjbName() + "MethodPermission3";
+ permissionPrefix = nameBase + "MethodPermission3";
org.jboss.metadata.MethodMetaData<?> methodMetaData = methods.next();
if (count <= 5)
@@ -824,7 +834,7 @@
}
assertEquals(beanMetaData.getEjbName(), size, count-1);
}
-*/
+
private void assertRolesNames(String prefix, int size, Set<String> roles)
{
assertNotNull(roles);
@@ -873,7 +883,7 @@
}
}
-/* private void assertMethods(String ejbName, String prefix, int size, Iterator<org.jboss.metadata.MethodMetaData> methods)
+ private void assertMethods(String ejbName, String prefix, int size, Iterator<org.jboss.metadata.MethodMetaData> methods)
{
assertNotNull(methods);
int count = 1;
@@ -901,7 +911,7 @@
}
assertEquals(size, count-1);
}
-*/
+
protected void assertMethodParams(String prefix, int size, MethodParametersMetaData methodParametersMetaData)
{
assertNotNull(methodParametersMetaData);
@@ -947,7 +957,7 @@
}
}
-/* private void assertContainerTransactions(Iterator<org.jboss.metadata.MethodMetaData> transactions)
+ private void assertContainerTransactions(Iterator<org.jboss.metadata.MethodMetaData> transactions)
{
assertNotNull(transactions);
int count = 1;
@@ -970,7 +980,7 @@
}
assertEquals(10, count-1);
}
-*/
+
protected void assertExcludeList(String ejbName, int size, int limit, ExcludeListMetaData excludeListMetaData)
{
assertNotNull(excludeListMetaData);
@@ -982,12 +992,12 @@
assertMethods(null, "excludeListMethod", size, limit, excludeListMetaData.getMethods());
}
-/* private void assertExcludedMethods(String ejbName, Iterator<org.jboss.metadata.MethodMetaData> excluded)
+ private void assertExcludedMethods(String ejbName, Iterator<org.jboss.metadata.MethodMetaData> excluded)
{
- assertMethods(ejbName, ejbName + "ExcludeListMethod", 5, excluded);
+ assertMethods(ejbName + "EjbName", ejbName + "ExcludeListMethod", 5, excluded);
}
-*/
-/* protected void assertEnvironment(String prefix, BeanMetaData bean, boolean full)
+
+ protected void assertEnvironment(String prefix, BeanMetaData bean, boolean full)
{
if (full)
assertEnvEntries(prefix, 2, bean.getEnvironmentEntries(), full);
@@ -998,8 +1008,8 @@
assertResourceEnvRefs(prefix, 2, bean.getResourceEnvReferences(), full);
assertMessageDestinationRefs(prefix, 3, bean.getMessageDestinationReferences(), full);
}
-*/
-/* protected void assertNullEnvironment(BeanMetaData bean)
+
+ protected void assertNullEnvironment(BeanMetaData bean)
{
assertEmptyIterator(bean.getEnvironmentEntries());
assertEmptyIterator(bean.getEjbReferences());
@@ -1009,7 +1019,7 @@
assertEmptyIterator(bean.getResourceEnvReferences());
assertEmptyIterator(bean.getMessageDestinationReferences());
}
-*/
+
protected void assertSecurityIdentity(String ejbName, String type, SecurityIdentityMetaData securityIdentity, boolean full)
{
assertNotNull(ejbName, securityIdentity);
@@ -1024,7 +1034,7 @@
}
}
-/* protected void assertSecurityIdentity(String ejbName, String type, org.jboss.metadata.SecurityIdentityMetaData securityIdentity, boolean full)
+ protected void assertSecurityIdentity(String ejbName, String type, org.jboss.metadata.SecurityIdentityMetaData securityIdentity, boolean full)
{
assertNotNull(ejbName, securityIdentity);
String prefix = ejbName + type;
@@ -1035,7 +1045,7 @@
assertEquals(prefix + "RunAsRoleName", securityIdentity.getRunAsRoleName());
}
}
-*/
+
protected void assertRunAs(String prefix, String type, RunAsMetaData runAsMetaData)
{
assertNotNull(runAsMetaData);
@@ -1059,7 +1069,7 @@
}
}
-/* protected void assertSecurityRoleRefs(String ejbName, int size, Iterator<org.jboss.metadata.SecurityRoleRefMetaData> securityRoleRefs)
+ protected void assertSecurityRoleRefs(String ejbName, int size, Iterator<org.jboss.metadata.SecurityRoleRefMetaData> securityRoleRefs)
{
assertNotNull(securityRoleRefs);
int count = 1;
@@ -1073,7 +1083,7 @@
}
assertEquals(ejbName, size, count-1);
}
-*/
+
protected void assertClusterConfig(String prefix, ClusterConfigMetaData clusterConfig, boolean isSession)
{
assertNotNull(clusterConfig);
@@ -1087,7 +1097,7 @@
assertEquals(prefix + "SessionStateManagerJndiName", clusterConfig.getSessionStateManagerJndiName());
}
-/* protected void assertClusterConfig(String prefix, org.jboss.metadata.ClusterConfigMetaData clusterConfig, boolean isSession)
+ protected void assertClusterConfig(String prefix, org.jboss.metadata.ClusterConfigMetaData clusterConfig, boolean isSession)
{
assertNotNull(clusterConfig);
prefix = prefix + "ClusterConfig";
@@ -1097,7 +1107,7 @@
if (isSession)
assertEquals(prefix + "SessionStateManagerJndiName", clusterConfig.getHaSessionStateName());
}
-*/
+
protected void assertCacheInvalidationConfig(String prefix, CacheInvalidationConfigMetaData invalidationConfig)
{
assertNotNull(invalidationConfig);
@@ -1108,14 +1118,14 @@
assertEquals(prefix + "InvalidationManagerName", invalidationConfig.getInvalidationManagerName());
}
-/* protected void assertCacheInvalidationConfig(String prefix, org.jboss.metadata.CacheInvalidationConfigMetaData invalidationConfig)
+ protected void assertCacheInvalidationConfig(String prefix, org.jboss.metadata.CacheInvalidationConfigMetaData invalidationConfig)
{
assertNotNull(invalidationConfig);
prefix = prefix + "CacheInvalidationConfig";
assertEquals(prefix + "InvalidationGroupName", invalidationConfig.getInvalidationGroupName());
assertEquals(prefix + "InvalidationManagerName", invalidationConfig.getInvalidationManagerName());
}
-*/
+
protected void assertIORSecurityConfig(String ejbName, IORSecurityConfigMetaData iorSecurityConfig)
{
assertNotNull(iorSecurityConfig);
@@ -1127,14 +1137,14 @@
assertIORSASContext(ejbName, iorSecurityConfig.getSasContext());
}
-/* protected void assertIORSecurityConfig(String ejbName, IorSecurityConfigMetaData iorSecurityConfig)
+ protected void assertIORSecurityConfig(String ejbName, IorSecurityConfigMetaData iorSecurityConfig)
{
assertNotNull(iorSecurityConfig);
assertIORTransportConfig(ejbName, iorSecurityConfig.getTransportConfig());
assertIORASContext(ejbName, iorSecurityConfig.getAsContext());
assertIORSASContext(ejbName, iorSecurityConfig.getSasContext());
}
-*/
+
protected void assertIORTransportConfig(String ejbName, IORTransportConfigMetaData iorTransportConfig)
{
assertNotNull(iorTransportConfig);
@@ -1149,7 +1159,7 @@
assertEquals(IORTransportConfigMetaData.DETECT_REPLAY_NONE, iorTransportConfig.getDetectReplay());
}
-/* protected void assertIORTransportConfig(String ejbName, IorSecurityConfigMetaData.TransportConfig iorTransportConfig)
+ protected void assertIORTransportConfig(String ejbName, IorSecurityConfigMetaData.TransportConfig iorTransportConfig)
{
assertNotNull(iorTransportConfig);
assertEquals(IORTransportConfigMetaData.INTEGRITY_NONE, iorTransportConfig.getIntegrity());
@@ -1159,7 +1169,7 @@
assertEquals(IORTransportConfigMetaData.DETECT_MISORDERING_NONE, iorTransportConfig.getDetectMisordering());
assertEquals(IORTransportConfigMetaData.DETECT_REPLAY_NONE, iorTransportConfig.getDetectReplay());
}
-*/
+
protected void assertIORASContext(String ejbName, IORASContextMetaData asContext)
{
assertNotNull(asContext);
@@ -1171,7 +1181,7 @@
assertFalse(asContext.isRequired());
}
-/* protected void assertIORASContext(String ejbName, IorSecurityConfigMetaData.AsContext asContext)
+ protected void assertIORASContext(String ejbName, IorSecurityConfigMetaData.AsContext asContext)
{
assertNotNull(asContext);
String prefix = ejbName + "ASContext";
@@ -1179,7 +1189,7 @@
assertEquals(prefix + "Realm", asContext.getRealm());
assertFalse(asContext.isRequired());
}
-*/
+
protected void assertIORSASContext(String ejbName, IORSASContextMetaData sasContext)
{
assertNotNull(sasContext);
@@ -1189,12 +1199,12 @@
assertEquals(IORSASContextMetaData.CALLER_PROPAGATION_NONE, sasContext.getCallerPropagation());
}
-/* protected void assertIORSASContext(String ejbName, IorSecurityConfigMetaData.SasContext sasContext)
+ protected void assertIORSASContext(String ejbName, IorSecurityConfigMetaData.SasContext sasContext)
{
assertNotNull(sasContext);
assertEquals(IORSASContextMetaData.CALLER_PROPAGATION_NONE, sasContext.getCallerPropagation());
}
-*/
+
protected void assertIgnoreDependency(String ejbName, IgnoreDependencyMetaData ignoreDependency)
{
assertNotNull(ejbName, ignoreDependency);
@@ -1242,17 +1252,17 @@
}
}
-/* protected void assertMethodAttributes(String ejbName, BeanMetaData bean)
+ protected void assertMethodAttributes(String ejbName, BeanMetaData bean)
{
assertDefaultMethodAttributes(ejbName, bean);
}
-*/
-/* protected void assertDefaultMethodAttributes(String ejbName, BeanMetaData bean)
+
+ protected void assertDefaultMethodAttributes(String ejbName, BeanMetaData bean)
{
assertFalse(bean.isMethodReadOnly("getSomething"));
assertEquals(0, bean.getTransactionTimeout("getSomething"));
}
-*/
+
private void assertEmptyIterator(Iterator i)
{
if (i != null && i.hasNext())
Modified: projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EjbJar21EverythingUnitTestCase.java
===================================================================
--- projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EjbJar21EverythingUnitTestCase.java 2007-09-16 14:12:15 UTC (rev 65432)
+++ projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EjbJar21EverythingUnitTestCase.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -25,6 +25,7 @@
import junit.framework.Test;
+import org.jboss.metadata.ApplicationMetaData;
import org.jboss.metadata.ejb.spec.CMPFieldMetaData;
import org.jboss.metadata.ejb.spec.CMPFieldsMetaData;
import org.jboss.metadata.ejb.spec.EjbJar21MetaData;
@@ -82,25 +83,37 @@
//enableTrace("org.jboss.xb");
//enableTrace("org.jboss.xb.builder");
EjbJar2xMetaData ejbJarMetaData = unmarshal();
- assertEverything(ejbJarMetaData);
+ assertEverythingWithAppMetaData(ejbJarMetaData);
}
public void assertEverything(EjbJar2xMetaData ejbJarMetaData)
{
- //ApplicationMetaData applicationMetaData = new ApplicationMetaData(ejbJarMetaData);
assertVersion(ejbJarMetaData);
- //assertVersion(applicationMetaData);
assertId("ejb-jar", ejbJarMetaData);
assertEquals("ejb-jar-id", ejbJarMetaData.getId());
assertEjbClientJar(ejbJarMetaData);
assertDescriptionGroup("ejb-jar", ejbJarMetaData.getDescriptionGroup());
assertEnterpriseBeans(ejbJarMetaData);
- //assertEnterpriseBeans(applicationMetaData);
assertRelationships(ejbJarMetaData);
- //assertRelationships(applicationMetaData);
assertAssemblyDescriptor(ejbJarMetaData);
- //assertAssemblyDescriptor(applicationMetaData);
}
+
+ public void assertEverythingWithAppMetaData(EjbJar2xMetaData ejbJarMetaData)
+ {
+ ApplicationMetaData applicationMetaData = new ApplicationMetaData(ejbJarMetaData);
+ assertVersion(ejbJarMetaData);
+ assertVersion(applicationMetaData);
+ assertId("ejb-jar", ejbJarMetaData);
+ assertEquals("ejb-jar-id", ejbJarMetaData.getId());
+ assertEjbClientJar(ejbJarMetaData);
+ assertDescriptionGroup("ejb-jar", ejbJarMetaData.getDescriptionGroup());
+ assertEnterpriseBeans(ejbJarMetaData);
+ assertEnterpriseBeans(applicationMetaData);
+ assertRelationships(ejbJarMetaData);
+ assertRelationships(applicationMetaData);
+ assertAssemblyDescriptor(ejbJarMetaData);
+ assertAssemblyDescriptor(applicationMetaData);
+ }
private void assertVersion(EjbJar2xMetaData ejbJar2xMetaData)
{
@@ -111,14 +124,14 @@
assertFalse(ejbJar2xMetaData.isEJB3x());
}
-/* private void assertVersion(ApplicationMetaData applicationMetadata)
+ private void assertVersion(ApplicationMetaData applicationMetadata)
{
assertFalse(applicationMetadata.isEJB1x());
assertTrue(applicationMetadata.isEJB2x());
assertTrue(applicationMetadata.isEJB21());
assertFalse(applicationMetadata.isEJB3x());
}
-*/
+
protected SessionBeanMetaData assertFullSession(String ejbName, EnterpriseBeansMetaData enterpriseBeansMetaData)
{
SessionBeanMetaData session = assertSession(ejbName + "EjbName", enterpriseBeansMetaData);
Modified: projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EjbJar21UnitTestCase.java
===================================================================
--- projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EjbJar21UnitTestCase.java 2007-09-16 14:12:15 UTC (rev 65432)
+++ projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EjbJar21UnitTestCase.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -25,6 +25,7 @@
import junit.framework.Test;
+import org.jboss.metadata.ApplicationMetaData;
import org.jboss.metadata.ejb.spec.EjbJar21MetaData;
import org.jboss.metadata.ejb.spec.EjbJar2xMetaData;
import org.jboss.test.metadata.javaee.AbstractJavaEEMetaDataTest;
@@ -68,10 +69,10 @@
assertTrue(result.isEJB21());
assertFalse(result.isEJB3x());
-/* ApplicationMetaData old = new ApplicationMetaData(result);
+ ApplicationMetaData old = new ApplicationMetaData(result);
assertFalse(old.isEJB1x());
assertTrue(old.isEJB2x());
assertTrue(old.isEJB21());
assertFalse(old.isEJB3x());
-*/ }
+ }
}
Modified: projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EjbJar3xEverythingUnitTestCase.java
===================================================================
--- projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EjbJar3xEverythingUnitTestCase.java 2007-09-16 14:12:15 UTC (rev 65432)
+++ projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EjbJar3xEverythingUnitTestCase.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -25,6 +25,7 @@
import junit.framework.Test;
+import org.jboss.metadata.ApplicationMetaData;
import org.jboss.metadata.ejb.spec.ApplicationExceptionMetaData;
import org.jboss.metadata.ejb.spec.ApplicationExceptionsMetaData;
import org.jboss.metadata.ejb.spec.AroundInvokeMetaData;
@@ -95,27 +96,40 @@
//enableTrace("org.jboss.xb");
//enableTrace("org.jboss.xb.builder");
EjbJar3xMetaData ejbJarMetaData = unmarshal();
- assertEverything(ejbJarMetaData);
+ assertEverythingWithAppMetaData(ejbJarMetaData);
}
public void assertEverything(EjbJar3xMetaData ejbJarMetaData)
{
- //ApplicationMetaData applicationMetaData = new ApplicationMetaData(ejbJarMetaData);
assertVersion(ejbJarMetaData);
- //assertVersion(applicationMetaData);
assertMetaDataComplete(ejbJarMetaData);
assertId("ejb-jar", ejbJarMetaData);
assertEjbClientJar(ejbJarMetaData);
assertDescriptionGroup("ejb-jar", ejbJarMetaData.getDescriptionGroup());
assertEnterpriseBeans(ejbJarMetaData);
- //assertEnterpriseBeans(applicationMetaData);
assertInterceptors(ejbJarMetaData);
assertRelationships(ejbJarMetaData);
- //assertRelationships(applicationMetaData);
assertAssemblyDescriptor(ejbJarMetaData);
- //assertAssemblyDescriptor(applicationMetaData);
}
-
+
+ public void assertEverythingWithAppMetaData(EjbJar3xMetaData ejbJarMetaData)
+ {
+ ApplicationMetaData applicationMetaData = new ApplicationMetaData(ejbJarMetaData);
+ assertVersion(ejbJarMetaData);
+ assertVersion(applicationMetaData);
+ assertMetaDataComplete(ejbJarMetaData);
+ assertId("ejb-jar", ejbJarMetaData);
+ assertEjbClientJar(ejbJarMetaData);
+ assertDescriptionGroup("ejb-jar", ejbJarMetaData.getDescriptionGroup());
+ assertEnterpriseBeans(ejbJarMetaData);
+ assertEnterpriseBeans(applicationMetaData);
+ assertInterceptors(ejbJarMetaData);
+ assertRelationships(ejbJarMetaData);
+ assertRelationships(applicationMetaData);
+ assertAssemblyDescriptor(ejbJarMetaData);
+ assertAssemblyDescriptor(applicationMetaData);
+ }
+
private void assertVersion(EjbJar3xMetaData ejbJar3xMetaData)
{
assertEquals("3.0", ejbJar3xMetaData.getVersion());
@@ -125,14 +139,14 @@
assertTrue(ejbJar3xMetaData.isEJB3x());
}
-/* private void assertVersion(ApplicationMetaData applicationMetadata)
+ private void assertVersion(ApplicationMetaData applicationMetadata)
{
assertFalse(applicationMetadata.isEJB1x());
assertFalse(applicationMetadata.isEJB2x());
assertFalse(applicationMetadata.isEJB21());
assertTrue(applicationMetadata.isEJB3x());
}
-*/
+
private void assertMetaDataComplete(EjbJar3xMetaData ejbJar3xMetaData)
{
assertEquals(true, ejbJar3xMetaData.isMetadataComplete());
@@ -394,11 +408,11 @@
assertMessageDestination50(prefix, messageDestinationMetaData);
}
-/* protected void assertMessageDestination(String prefix, org.jboss.metadata.MessageDestinationMetaData messageDestinationMetaData)
+ protected void assertMessageDestination(String prefix, org.jboss.metadata.MessageDestinationMetaData messageDestinationMetaData)
{
assertMessageDestination50(prefix, messageDestinationMetaData);
}
-*/
+
private void assertApplicationExceptions(int size, ApplicationExceptionsMetaData applicationExceptionsMetaData)
{
assertNotNull(applicationExceptionsMetaData);
Modified: projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EjbJar3xUnitTestCase.java
===================================================================
--- projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EjbJar3xUnitTestCase.java 2007-09-16 14:12:15 UTC (rev 65432)
+++ projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EjbJar3xUnitTestCase.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -22,8 +22,12 @@
package org.jboss.test.metadata.ejb;
+import java.util.Iterator;
+
import junit.framework.Test;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.BeanMetaData;
import org.jboss.metadata.ejb.spec.EjbJar30MetaData;
import org.jboss.metadata.ejb.spec.EjbJar3xMetaData;
import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
@@ -85,12 +89,12 @@
assertFalse(result.isEJB21());
assertTrue(result.isEJB3x());
-/* ApplicationMetaData old = new ApplicationMetaData(result);
+ ApplicationMetaData old = new ApplicationMetaData(result);
assertFalse(old.isEJB1x());
assertFalse(old.isEJB2x());
assertFalse(old.isEJB21());
assertTrue(old.isEJB3x());
-*/ }
+ }
public void testDescriptionDefaultLanguage() throws Exception
{
@@ -148,11 +152,11 @@
EnterpriseBeanMetaData bean = beans.iterator().next();
assertEquals("TestBean", bean.getEjbName());
-/* ApplicationMetaData old = new ApplicationMetaData(result);
+ ApplicationMetaData old = new ApplicationMetaData(result);
Iterator<BeanMetaData> iterator = old.getEnterpriseBeans();
assertTrue(iterator.hasNext());
BeanMetaData beanMetaData = iterator.next();
assertEquals("TestBean", beanMetaData.getEjbName());
assertFalse(iterator.hasNext());
-*/ }
+ }
}
Modified: projects/metadata/trunk/src/test/java/org/jboss/test/metadata/javaee/AbstractJavaEEEverythingTest.java
===================================================================
--- projects/metadata/trunk/src/test/java/org/jboss/test/metadata/javaee/AbstractJavaEEEverythingTest.java 2007-09-16 14:12:15 UTC (rev 65432)
+++ projects/metadata/trunk/src/test/java/org/jboss/test/metadata/javaee/AbstractJavaEEEverythingTest.java 2007-09-16 21:53:31 UTC (rev 65433)
@@ -21,6 +21,8 @@
*/
package org.jboss.test.metadata.javaee;
+import java.util.Iterator;
+import java.util.Map;
import java.util.Set;
import org.jboss.annotation.javaee.Description;
@@ -29,6 +31,12 @@
import org.jboss.annotation.javaee.DisplayNames;
import org.jboss.annotation.javaee.Icon;
import org.jboss.annotation.javaee.Icons;
+import org.jboss.metadata.EjbLocalRefMetaData;
+import org.jboss.metadata.EjbRefMetaData;
+import org.jboss.metadata.EnvEntryMetaData;
+import org.jboss.metadata.MessageDestinationRefMetaData;
+import org.jboss.metadata.ResourceEnvRefMetaData;
+import org.jboss.metadata.ResourceRefMetaData;
import org.jboss.metadata.javaee.jboss.AnnotationMetaData;
import org.jboss.metadata.javaee.jboss.AnnotationPropertiesMetaData;
import org.jboss.metadata.javaee.jboss.AnnotationPropertyMetaData;
@@ -209,7 +217,7 @@
}
}
-/* protected void assertSecurityRoles(int size, Map<String, org.jboss.security.SecurityRoleMetaData> securityRoles)
+ protected void assertSecurityRoles(int size, Map<String, org.jboss.security.SecurityRoleMetaData> securityRoles)
{
assertNotNull(securityRoles);
assertEquals(size, securityRoles.size());
@@ -226,7 +234,7 @@
assertNotNull(securityRole);
assertEquals(prefix + "RoleName", securityRole.getRoleName());
}
-*/
+
protected void assertMessageDestinations(int size, MessageDestinationsMetaData messageDestinationsMetaData)
{
assertNotNull(messageDestinationsMetaData);
@@ -272,7 +280,7 @@
assertEquals(prefix + "MappedName", messageDestinationMetaData.getMappedName());
}
-/* protected void assertMessageDestination(String prefix, org.jboss.metadata.MessageDestinationMetaData messageDestinationMetaData)
+ protected void assertMessageDestination(String prefix, org.jboss.metadata.MessageDestinationMetaData messageDestinationMetaData)
{
assertMessageDestination14(prefix, messageDestinationMetaData);
}
@@ -288,7 +296,7 @@
assertMessageDestination14(prefix, messageDestinationMetaData);
assertEquals(prefix + "MappedName", messageDestinationMetaData.getJNDIName());
}
-*/
+
protected void assertLifecycleCallbacks(String ejbName, String type, int size, LifecycleCallbacksMetaData lifecycleCallbacksMetaData)
{
assertNotNull(lifecycleCallbacksMetaData);
@@ -356,7 +364,7 @@
++count;
}
}
-/*
+
protected void assertEnvEntries(String prefix, int size, Iterator<EnvEntryMetaData> envEntries, boolean full)
{
assertNotNull(envEntries);
@@ -372,7 +380,7 @@
}
assertEquals(size + 1, count);
}
-*/
+
protected EJBReferencesMetaData fixUpEjbRefs(EJBReferencesMetaData overriden, EJBReferencesMetaData override)
{
if (override == null || override.isEmpty())
@@ -419,7 +427,7 @@
++count;
}
}
-/*
+
protected void assertEjbRefs(String prefix, int size, Iterator<EjbRefMetaData> ejbRefs, boolean full)
{
assertNotNull(ejbRefs);
@@ -444,7 +452,7 @@
}
assertEquals(size + 1, count);
}
-*/
+
protected EJBLocalReferencesMetaData fixUpEjbLocalRefs(EJBLocalReferencesMetaData overriden, EJBLocalReferencesMetaData override)
{
if (override == null || override.isEmpty())
@@ -491,7 +499,7 @@
++count;
}
}
-/*
+
protected void assertEjbLocalRefs(String prefix, int size, Iterator<EjbLocalRefMetaData> ejbLocalRefs, boolean full)
{
assertNotNull(ejbLocalRefs);
@@ -516,7 +524,7 @@
}
assertEquals(size + 1, count);
}
-*/
+
protected ResourceReferencesMetaData fixUpResourceRefs(ResourceReferencesMetaData overriden, ResourceReferencesMetaData override)
{
if (override == null || override.isEmpty())
@@ -567,7 +575,7 @@
++count;
}
}
-/*
+
protected void assertResourceRefs(String prefix, int size, Iterator<ResourceRefMetaData> resRefs, boolean full)
{
assertNotNull(resRefs);
@@ -596,7 +604,7 @@
}
assertEquals(size + 1, count);
}
-*/
+
protected ResourceEnvironmentReferencesMetaData fixUpResourceEnvRefs(ResourceEnvironmentReferencesMetaData overriden, ResourceEnvironmentReferencesMetaData override)
{
if (override == null || override.isEmpty())
@@ -635,7 +643,7 @@
++count;
}
}
-/*
+
protected void assertResourceEnvRefs(String prefix, int size, Iterator<ResourceEnvRefMetaData> resEnvRefs, boolean full)
{
assertNotNull(resEnvRefs);
@@ -654,7 +662,7 @@
}
assertEquals(size + 1, count);
}
-*/
+
protected MessageDestinationReferencesMetaData fixUpMessageDestinationRefs(MessageDestinationReferencesMetaData overriden, MessageDestinationReferencesMetaData override)
{
if (override == null || override.isEmpty())
@@ -702,7 +710,7 @@
++count;
}
}
-/*
+
protected void assertMessageDestinationRefs(String prefix, int size, Iterator<MessageDestinationRefMetaData> refs, boolean full)
{
assertNotNull(refs);
@@ -727,7 +735,7 @@
}
assertEquals(size + 1, count);
}
-*/
+
protected void assertPersistenceContextRefs(String prefix, int size, PersistenceContextReferencesMetaData persistenceContextReferencesMetaData)
{
assertNotNull(persistenceContextReferencesMetaData);
More information about the jboss-cvs-commits
mailing list