You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2008/10/20 20:23:42 UTC
svn commit: r706357 [6/13] - in
/geronimo/server/trunk/plugins/connector-1_6: ./ client-transaction-1_6/
client-transaction-1_6/src/ client-transaction-1_6/src/main/
client-transaction-1_6/src/main/history/
client-transaction-1_6/src/main/plan/ client-...
Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,425 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.geronimo.connector.deployment;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.annotation.Resource;
+import javax.resource.ResourceException;
+import javax.xml.namespace.QName;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.SingleElementCollection;
+import org.apache.geronimo.j2ee.deployment.CorbaGBeanNameSource;
+import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
+import org.apache.geronimo.j2ee.deployment.annotation.ResourceAnnotationHelper;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.Dependency;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentBuilder;
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
+import org.apache.geronimo.naming.reference.ORBReference;
+import org.apache.geronimo.naming.reference.ResourceReferenceFactory;
+import org.apache.geronimo.naming.reference.URLReference;
+import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefDocument;
+import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
+import org.apache.geronimo.xbeans.javaee.DescriptionType;
+import org.apache.geronimo.xbeans.javaee.FullyQualifiedClassType;
+import org.apache.geronimo.xbeans.javaee.InjectionTargetType;
+import org.apache.geronimo.xbeans.javaee.JndiNameType;
+import org.apache.geronimo.xbeans.javaee.ResAuthType;
+import org.apache.geronimo.xbeans.javaee.ResSharingScopeType;
+import org.apache.geronimo.xbeans.javaee.ResourceRefType;
+import org.apache.geronimo.xbeans.javaee.XsdStringType;
+import org.apache.geronimo.deployment.service.EnvironmentBuilder;
+import org.apache.xmlbeans.QNameSet;
+import org.apache.xmlbeans.XmlObject;
+import org.omg.CORBA.ORB;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ResourceRefBuilder extends AbstractNamingBuilder implements ResourceEnvironmentSetter {
+
+ private static final Logger log = LoggerFactory.getLogger(ResourceRefBuilder.class);
+
+ private static final QName GER_RESOURCE_REF_QNAME = GerResourceRefDocument.type.getDocumentElementName();
+ private static final QNameSet GER_RESOURCE_REF_QNAME_SET = QNameSet.singleton(GER_RESOURCE_REF_QNAME);
+ private static final String JAXR_CONNECTION_FACTORY_CLASS = "javax.xml.registry.ConnectionFactory";
+ private static final String JAVAX_MAIL_SESSION_CLASS = "javax.mail.Session";
+
+
+ private final QNameSet resourceRefQNameSet;
+ private final Environment corbaEnvironment;
+ private final SingleElementCollection corbaGBeanNameSourceCollection;
+
+ public ResourceRefBuilder(Environment defaultEnvironment, Environment corbaEnvironment, String[] eeNamespaces, Collection corbaGBeanNameSourceCollection) {
+ super(defaultEnvironment);
+
+ resourceRefQNameSet = buildQNameSet(eeNamespaces, "resource-ref");
+ this.corbaEnvironment = corbaEnvironment;
+ this.corbaGBeanNameSourceCollection = new SingleElementCollection(corbaGBeanNameSourceCollection);
+ }
+
+ protected boolean willMergeEnvironment(XmlObject specDD, XmlObject plan) {
+ return specDD.selectChildren(resourceRefQNameSet).length > 0;
+ }
+
+ public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
+
+ // Discover and process any @Resource annotations (if !metadata-complete)
+ if ((module != null) && (module.getClassFinder() != null)) {
+
+ // Process all the annotations for this naming builder type
+ try {
+ ResourceAnnotationHelper.processAnnotations(module.getAnnotatedApp(), module.getClassFinder(), ResourceRefProcessor.INSTANCE);
+ }
+ catch (Exception e) {
+ log.warn("Unable to process @Resource annotations for module" + module.getName(), e);
+ }
+ }
+
+ List<ResourceRefType> resourceRefsUntyped = convert(specDD.selectChildren(resourceRefQNameSet), J2EE_CONVERTER, ResourceRefType.class, ResourceRefType.type);
+ XmlObject[] gerResourceRefsUntyped = plan == null ? NO_REFS : plan.selectChildren(GER_RESOURCE_REF_QNAME_SET);
+ Map refMap = mapResourceRefs(gerResourceRefsUntyped);
+ List unresolvedRefs = new ArrayList();
+ ClassLoader cl = module.getEarContext().getClassLoader();
+ for (ResourceRefType resourceRef : resourceRefsUntyped) {
+ String name = resourceRef.getResRefName().getStringValue().trim();
+ if (lookupJndiContextMap(componentContext, ENV + name) != null) {
+ // some other builder handled this entry already
+ continue;
+ }
+ addInjections(name, resourceRef.getInjectionTargetArray(), componentContext);
+ String type = resourceRef.getResType().getStringValue().trim();
+ GerResourceRefType gerResourceRef = (GerResourceRefType) refMap.get(name);
+ log.debug("trying to resolve " + name + ", type " + type + ", resourceRef " + gerResourceRef);
+ if(!refMap.containsKey(name)){
+ unresolvedRefs.add(name);
+ }
+ Class iface;
+ try {
+ iface = cl.loadClass(type);
+ } catch (ClassNotFoundException e) {
+ throw new DeploymentException("could not load class " + type, e);
+ }
+ if (iface == URL.class) {
+ if (gerResourceRef == null || !gerResourceRef.isSetUrl()) {
+ throw new DeploymentException("No url supplied to resolve: " + name);
+ }
+ String url = gerResourceRef.getUrl().trim();
+ //TODO expose jsr-77 objects for these guys
+ try {
+ //check for malformed URL
+ new URL(url);
+ } catch (MalformedURLException e) {
+ throw new DeploymentException("Could not convert " + url + " to URL", e);
+ }
+ getJndiContextMap(componentContext).put(ENV + name, new URLReference(url));
+ unresolvedRefs.remove(name);
+ } else if (ORB.class.isAssignableFrom(iface)) {
+ CorbaGBeanNameSource corbaGBeanNameSource = (CorbaGBeanNameSource) corbaGBeanNameSourceCollection.getElement();
+ if (corbaGBeanNameSource == null) {
+ throw new DeploymentException("No orb setup but there is a orb reference");
+ }
+ AbstractNameQuery corbaName = corbaGBeanNameSource.getCorbaGBeanName();
+ if (corbaName != null) {
+ Artifact[] moduleId = module.getConfigId();
+ Map context = getJndiContextMap(componentContext);
+ context.put(ENV + name, new ORBReference(moduleId, corbaName));
+ unresolvedRefs.remove(name);
+ EnvironmentBuilder.mergeEnvironments(module.getEnvironment(), corbaEnvironment);
+ }
+ } else {
+ //determine jsr-77 type from interface
+ String j2eeType;
+
+
+ if (JAVAX_MAIL_SESSION_CLASS.equals(type)) {
+ j2eeType = NameFactory.JAVA_MAIL_RESOURCE;
+ } else if (JAXR_CONNECTION_FACTORY_CLASS.equals(type)) {
+ j2eeType = NameFactory.JAXR_CONNECTION_FACTORY;
+ } else {
+ j2eeType = NameFactory.JCA_MANAGED_CONNECTION_FACTORY;
+ }
+ try {
+ AbstractNameQuery containerId = getResourceContainerId(name, j2eeType, null, gerResourceRef);
+
+ module.getEarContext().findGBean(containerId);
+
+ Object ref = new ResourceReferenceFactory<ResourceException>(module.getConfigId(), containerId, iface);
+ getJndiContextMap(componentContext).put(ENV + name, ref);
+ // we thought that this might be an unresolved
+ // name because it wasn't in the refMap, but now
+ // we've found it so we can take it out of the
+ // unresolvedRefs list
+ unresolvedRefs.remove(name);
+ } catch (GBeanNotFoundException e) {
+
+ StringBuffer errorMessage = new StringBuffer("Unable to resolve resource reference '");
+ errorMessage.append(name);
+ errorMessage.append("' (");
+ if (e.hasMatches()) {
+ errorMessage.append("Found multiple matching resources. Try being more specific in a resource-ref mapping in your Geronimo deployment plan.\n");
+ for (AbstractName match : e.getMatches()) {
+ errorMessage.append(match).append("\n");
+ }
+ } else if (gerResourceRef == null) {
+ errorMessage.append("Could not auto-map to resource. Try adding a resource-ref mapping to your Geronimo deployment plan.");
+ } else if (gerResourceRef.isSetResourceLink()) {
+ errorMessage.append("Could not find resource '");
+ errorMessage.append(gerResourceRef.getResourceLink());
+ errorMessage.append("'. Perhaps it has not yet been configured, or your application does not have a dependency declared for that resource module?");
+ } else {
+ errorMessage.append("Could not find the resource specified in your Geronimo deployment plan:");
+ errorMessage.append(gerResourceRef.getPattern());
+ }
+ errorMessage.append("\nSearch conducted in current module and dependencies:\n");
+ for (Dependency dependency : module.getEnvironment().getDependencies()) {
+ errorMessage.append(dependency).append("\n");
+ }
+ errorMessage.append(")");
+
+ throw new DeploymentException(errorMessage.toString());
+ }
+ }
+ }
+
+ if (unresolvedRefs.size() > 0) {
+ log.warn("Failed to build reference to resource reference "+ unresolvedRefs +" defined in plan file, reason - corresponding entry in deployment descriptor missing.");
+ }
+ }
+
+ public void setResourceEnvironment(ResourceEnvironmentBuilder builder, XmlObject[] resourceRefs, GerResourceRefType[] gerResourceRefs) throws DeploymentException {
+ List<ResourceRefType> resourceRefList = convert(resourceRefs, J2EE_CONVERTER, ResourceRefType.class, ResourceRefType.type);
+ Map refMap = mapResourceRefs(gerResourceRefs);
+ Set unshareableResources = new HashSet();
+ Set applicationManagedSecurityResources = new HashSet();
+ for (ResourceRefType resourceRefType : resourceRefList) {
+
+ String type = resourceRefType.getResType().getStringValue().trim();
+
+ if (!URL.class.getName().equals(type)
+ && !"javax.mail.Session".equals(type)
+ && !JAXR_CONNECTION_FACTORY_CLASS.equals(type)) {
+
+ GerResourceRefType gerResourceRef = (GerResourceRefType) refMap.get(resourceRefType.getResRefName().getStringValue());
+ AbstractNameQuery containerId = getResourceContainerId(getStringValue(resourceRefType.getResRefName()), NameFactory.JCA_MANAGED_CONNECTION_FACTORY, null, gerResourceRef);
+
+ if ("Unshareable".equals(getStringValue(resourceRefType.getResSharingScope()))) {
+ unshareableResources.add(containerId);
+ }
+ if ("Application".equals(getStringValue(resourceRefType.getResAuth()))) {
+ applicationManagedSecurityResources.add(containerId);
+ }
+ }
+ }
+ builder.setUnshareableResources(unshareableResources);
+ builder.setApplicationManagedSecurityResources(applicationManagedSecurityResources);
+ }
+
+ private Map<String, GerResourceRefType> mapResourceRefs(XmlObject[] refs) {
+ Map<String, GerResourceRefType> refMap = new HashMap<String, GerResourceRefType>();
+ if (refs != null) {
+ for (XmlObject ref1 : refs) {
+ GerResourceRefType ref = (GerResourceRefType) ref1.copy().changeType(GerResourceRefType.type);
+ refMap.put(ref.getRefName().trim(), ref);
+ }
+ }
+ return refMap;
+ }
+
+ private AbstractNameQuery getResourceContainerId(String name, String type, URI moduleURI, GerResourceRefType gerResourceRef) {
+ AbstractNameQuery containerId;
+ String module = moduleURI == null ? null : moduleURI.toString();
+ if (gerResourceRef == null) {
+ containerId = buildAbstractNameQuery(null, module, name, type, NameFactory.RESOURCE_ADAPTER_MODULE);
+ } else if (gerResourceRef.isSetResourceLink()) {
+ containerId = buildAbstractNameQuery(null, module, gerResourceRef.getResourceLink().trim(), type, NameFactory.RESOURCE_ADAPTER_MODULE);
+ } else {
+ //construct name from components
+ GerPatternType patternType = gerResourceRef.getPattern();
+ containerId = buildAbstractNameQuery(patternType, type, NameFactory.RESOURCE_ADAPTER_MODULE, null);
+ }
+ return containerId;
+ }
+
+
+ public QNameSet getSpecQNameSet() {
+ return resourceRefQNameSet;
+ }
+
+ public QNameSet getPlanQNameSet() {
+ return GER_RESOURCE_REF_QNAME_SET;
+ }
+
+ public static class ResourceRefProcessor extends ResourceAnnotationHelper.ResourceProcessor {
+
+ public static final ResourceRefProcessor INSTANCE = new ResourceRefProcessor();
+
+ private ResourceRefProcessor() {
+ }
+
+ public boolean processResource(AnnotatedApp annotatedApp, Resource annotation, Class cls, Method method, Field field) {
+ log.debug("processResource( [annotatedApp] " + annotatedApp.toString() + "," + '\n' +
+ "[annotation] " + annotation.toString() + "," + '\n' +
+ "[cls] " + (cls != null ? cls.getName() : null) + "," + '\n' +
+ "[method] " + (method != null ? method.getName() : null) + "," + '\n' +
+ "[field] " + (field != null ? field.getName() : null) + " ): Entry");
+
+ String resourceName = getResourceName(annotation, method, field);
+ String resourceType = getResourceType(annotation, method, field);
+
+ if (resourceType.equals("javax.sql.DataSource") ||
+ resourceType.equals("javax.mail.Session") ||
+ resourceType.equals("java.net.URL") ||
+ resourceType.equals("org.omg.CORBA.ORB") ||
+ resourceType.equals("org.omg.CORBA_2_3.ORB") ||
+ resourceType.equals("org.omg.CORBA_2_4.ORB") ||
+ resourceType.endsWith("ConnectionFactory")) {
+
+ log.debug("processResource(): <resource-ref> found");
+
+ boolean exists = false;
+ ResourceRefType[] resourceRefs = annotatedApp.getResourceRefArray();
+ for (ResourceRefType resourceRef : resourceRefs) {
+ if (resourceRef.getResRefName().getStringValue().trim().equals(resourceName)) {
+ if (method != null || field != null) {
+ InjectionTargetType[] targets = resourceRef.getInjectionTargetArray();
+ if (!hasTarget(method, field, targets)) {
+ configureInjectionTarget(resourceRef.addNewInjectionTarget(), method, field);
+ }
+ }
+ exists = true;
+ break;
+ }
+ }
+ if (!exists) {
+ try {
+
+ log.debug("processResource(): Does not exist in DD: " + resourceName);
+
+ // Doesn't exist in deployment descriptor -- add new
+ ResourceRefType resourceRef = annotatedApp.addNewResourceRef();
+
+ //------------------------------------------------------------------------------
+ // <resource-ref> required elements:
+ //------------------------------------------------------------------------------
+
+ // resource-ref-name
+ JndiNameType resourceRefName = resourceRef.addNewResRefName();
+ resourceRefName.setStringValue(resourceName);
+
+ if (!resourceType.equals("")) {
+ // resource-ref-type
+ FullyQualifiedClassType qualifiedClass = resourceRef.addNewResType();
+ qualifiedClass.setStringValue(resourceType);
+ }
+ if (method != null || field != null) {
+ // injectionTarget
+ InjectionTargetType injectionTarget = resourceRef.addNewInjectionTarget();
+ configureInjectionTarget(injectionTarget, method, field);
+ }
+
+ //------------------------------------------------------------------------------
+ // <resource-ref> optional elements:
+ //------------------------------------------------------------------------------
+
+ // description
+ String descriptionAnnotation = annotation.description();
+ if (!descriptionAnnotation.equals("")) {
+ DescriptionType description = resourceRef.addNewDescription();
+ description.setStringValue(descriptionAnnotation);
+ }
+
+ // authentication
+ if (annotation.authenticationType() == Resource.AuthenticationType.CONTAINER) {
+ ResAuthType resAuth = resourceRef.addNewResAuth();
+ resAuth.setStringValue("Container");
+ resourceRef.setResAuth(resAuth);
+ } else if (annotation.authenticationType() == Resource.AuthenticationType.APPLICATION) {
+ ResAuthType resAuth = resourceRef.addNewResAuth();
+ resAuth.setStringValue("Application");
+ resourceRef.setResAuth(resAuth);
+ }
+
+ // sharing scope
+ ResSharingScopeType resScope = resourceRef.addNewResSharingScope();
+ resScope.setStringValue(annotation.shareable() ? "Shareable" : "Unshareable");
+ resourceRef.setResSharingScope(resScope);
+
+ // mappedName
+ String mappdedNameAnnotation = annotation.mappedName();
+ if (!mappdedNameAnnotation.equals("")) {
+ XsdStringType mappedName = resourceRef.addNewMappedName();
+ mappedName.setStringValue(mappdedNameAnnotation);
+ resourceRef.setMappedName(mappedName);
+ }
+
+ }
+ catch (Exception anyException) {
+ log.debug("ResourceRefBuilder: Exception caught while processing <resource-ref>");
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+ }
+
+
+ public static final GBeanInfo GBEAN_INFO;
+
+ static {
+ GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(ResourceRefBuilder.class, NameFactory.MODULE_BUILDER);
+ infoBuilder.addAttribute("eeNamespaces", String[].class, true, true);
+ infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
+ infoBuilder.addAttribute("corbaEnvironment", Environment.class, true, true);
+ infoBuilder.addReference("CorbaGBeanNameSource", CorbaGBeanNameSource.class);
+
+ infoBuilder.setConstructor(new String[]{"defaultEnvironment", "corbaEnvironment", "eeNamespaces", "CorbaGBeanNameSource"});
+
+ GBEAN_INFO = infoBuilder.getBeanInfo();
+ }
+
+ public static GBeanInfo getGBeanInfo() {
+ return GBEAN_INFO;
+ }
+}
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/AdminObjectDConfigBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/AdminObjectDConfigBean.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/AdminObjectDConfigBean.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/AdminObjectDConfigBean.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,106 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.geronimo.connector.deployment.dconfigbean;
+
+import javax.enterprise.deploy.model.DDBean;
+
+import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
+import org.apache.geronimo.xbeans.geronimo.GerAdminobjectInstanceType;
+import org.apache.geronimo.xbeans.geronimo.GerAdminobjectType;
+import org.apache.xmlbeans.SchemaTypeLoader;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ * */
+public class AdminObjectDConfigBean extends DConfigBeanSupport {
+ private AdminObjectInstance[] instances = new AdminObjectInstance[0];
+
+ public AdminObjectDConfigBean(DDBean ddBean, GerAdminobjectType adminObject) {
+ super(ddBean, adminObject);
+ String adminObjectInterface = ddBean.getText("adminobject-interface")[0];
+ if (adminObject.getAdminobjectInterface() == null) {
+ adminObject.setAdminobjectInterface(adminObjectInterface);
+ } else {
+ assert adminObjectInterface.equals(adminObject.getAdminobjectInterface());
+ }
+ String adminObjectClass = ddBean.getText("adminobject-class")[0];
+ if (adminObject.getAdminobjectClass() == null) {
+ adminObject.setAdminobjectClass(adminObjectClass);
+ } else {
+ assert adminObjectClass.equals(adminObject.getAdminobjectClass());
+ }
+ // Get initial list of instances
+ GerAdminobjectInstanceType[] xmlInstances = getAdminObject().getAdminobjectInstanceArray();
+ instances = new AdminObjectInstance[xmlInstances.length];
+ for (int i = 0; i < instances.length; i++) {
+ instances[i] = new AdminObjectInstance();
+ instances[i].initialize(xmlInstances[i], this);
+ }
+ }
+
+ GerAdminobjectType getAdminObject() {
+ return (GerAdminobjectType) getXmlObject();
+ }
+
+ public AdminObjectInstance[] getAdminObjectInstance() {
+ return instances;
+ }
+
+ public void setAdminObjectInstance(AdminObjectInstance[] instances) {
+ AdminObjectInstance[] old = getAdminObjectInstance();
+ this.instances = instances;
+ for (int i = 0; i < instances.length; i++) { // catch additions
+ AdminObjectInstance instance = instances[i];
+ if (!instance.hasParent()) {
+ GerAdminobjectInstanceType xmlObject = getAdminObject().addNewAdminobjectInstance();
+ instance.initialize(xmlObject, this);
+ }
+ }
+ for (int i = 0; i < old.length; i++) { // catch removals
+ AdminObjectInstance instance = old[i];
+ boolean found = false;
+ for (int j = 0; j < instances.length; j++) {
+ if (instances[j] == instance) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ // remove the XmlBean
+ for (int j = 0; j < getAdminObject().getAdminobjectInstanceArray().length; j++) {
+ GerAdminobjectInstanceType test = getAdminObject().getAdminobjectInstanceArray(j);
+ if (test == instance.getAdminobjectInstance()) {
+ getAdminObject().removeAdminobjectInstance(j);
+ break;
+ }
+ }
+ // clean up the removed JavaBean
+ instance.dispose();
+ }
+ }
+ pcs.firePropertyChange("adminObjectInstance", old, instances);
+ }
+
+ protected SchemaTypeLoader getSchemaTypeLoader() {
+ return ResourceAdapterDConfigRoot.SCHEMA_TYPE_LOADER;
+ }
+
+}
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/AdminObjectDConfigBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/AdminObjectDConfigBean.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/AdminObjectDConfigBean.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/AdminObjectInstance.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/AdminObjectInstance.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/AdminObjectInstance.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/AdminObjectInstance.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,114 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.geronimo.connector.deployment.dconfigbean;
+
+import javax.enterprise.deploy.model.DDBean;
+import javax.enterprise.deploy.model.XpathListener;
+
+import org.apache.geronimo.deployment.plugin.XmlBeanSupport;
+import org.apache.geronimo.xbeans.geronimo.GerAdminobjectInstanceType;
+import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
+import org.apache.xmlbeans.SchemaTypeLoader;
+import org.apache.xmlbeans.XmlBeans;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ * */
+public class AdminObjectInstance extends XmlBeanSupport {
+ private final static SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.getContextTypeLoader();
+ private AdminObjectDConfigBean parent;
+ private ConfigPropertySettings[] configs;
+ private XpathListener configListener;
+
+ public AdminObjectInstance() {
+ super(null);
+ }
+
+ void initialize(GerAdminobjectInstanceType xmlObject, AdminObjectDConfigBean parent) {
+ setXmlObject(xmlObject);
+ this.parent = parent;
+ DDBean parentDDBean = parent.getDDBean();
+ configListener = ConfigPropertiesHelper.initialize(parentDDBean, new ConfigPropertiesHelper.ConfigPropertiesSource() {
+ public GerConfigPropertySettingType[] getConfigPropertySettingArray() {
+ return getAdminobjectInstance().getConfigPropertySettingArray();
+ }
+
+ public GerConfigPropertySettingType addNewConfigPropertySetting() {
+ return getAdminobjectInstance().addNewConfigPropertySetting();
+ }
+
+ public void removeConfigPropertySetting(int j) {
+ getAdminobjectInstance().removeConfigPropertySetting(j);
+ }
+
+ public ConfigPropertySettings[] getConfigPropertySettings() {
+ return configs;
+ }
+
+ public void setConfigPropertySettings(ConfigPropertySettings[] configs) {
+ setConfigProperty(configs);
+ }
+
+ }, "config-property", "config-property-name");
+ }
+
+ boolean hasParent() {
+ return parent != null;
+ }
+
+ void dispose() {
+ if (configs != null) {
+ for (int i = 0; i < configs.length; i++) {
+ configs[i].dispose();
+ }
+ }
+ if (parent != null) {
+ parent.getDDBean().removeXpathListener("config-property", configListener);
+ }
+ configs = null;
+ configListener = null;
+ parent = null;
+ }
+
+// JavaBean properties for this object (with a couple helper methods)
+ GerAdminobjectInstanceType getAdminobjectInstance() {
+ return (GerAdminobjectInstanceType) getXmlObject();
+ }
+
+ public ConfigPropertySettings[] getConfigProperty() {
+ return configs;
+ }
+
+ private void setConfigProperty(ConfigPropertySettings[] configs) { // can only be changed by adding a new DDBean
+ ConfigPropertySettings[] old = getConfigProperty();
+ this.configs = configs;
+ pcs.firePropertyChange("configProperty", old, configs);
+ }
+
+ public String getMessageDestinationName() {
+ return getAdminobjectInstance().getMessageDestinationName();
+ }
+
+ public void setMessageDestinationName(String messageDestinationName) {
+ getAdminobjectInstance().setMessageDestinationName(messageDestinationName);
+ }
+
+}
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/AdminObjectInstance.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/AdminObjectInstance.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/AdminObjectInstance.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertiesHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertiesHelper.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertiesHelper.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertiesHelper.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,155 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.geronimo.connector.deployment.dconfigbean;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import javax.enterprise.deploy.model.DDBean;
+import javax.enterprise.deploy.model.XpathEvent;
+import javax.enterprise.deploy.model.XpathListener;
+
+import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ * */
+public class ConfigPropertiesHelper {
+
+ public static void initializeConfigSettings(DDBean ddBean, ConfigPropertiesSource configPropertiesSource, Map configPropertiesMap, String configPropertyXPath, String configPropertyNameXPath) {
+ DDBean[] configProperties = ddBean.getChildBean(configPropertyXPath);
+ GerConfigPropertySettingType[] configPropertySettings = configPropertiesSource.getConfigPropertySettingArray();
+
+ if (configPropertySettings.length == 0) {
+ //we are new
+ for (int i = 0; i < configProperties.length; i++) {
+ DDBean configProperty = configProperties[i];
+ GerConfigPropertySettingType configPropertySetting = configPropertiesSource.addNewConfigPropertySetting();
+ String name = configProperty.getText(configPropertyNameXPath)[0];
+ ConfigPropertySettingDConfigBean configPropertySettingDConfigBean = new ConfigPropertySettingDConfigBean(configProperty, configPropertySetting);
+ configPropertiesMap.put(name, configPropertySettingDConfigBean);
+ }
+ } else {
+ //we are read in from xml. Check correct length
+ assert configProperties.length == configPropertySettings.length;
+ for (int i = 0; i < configProperties.length; i++) {
+ DDBean configProperty = configProperties[i];
+ GerConfigPropertySettingType configPropertySetting = configPropertySettings[i];
+ String name = configProperty.getText(configPropertyNameXPath)[0];
+ assert name.equals(configPropertySetting.getName());
+ ConfigPropertySettingDConfigBean configPropertySettingDConfigBean = new ConfigPropertySettingDConfigBean(configProperty, configPropertySetting);
+ configPropertiesMap.put(name, configPropertySettingDConfigBean);
+ }
+ }
+ }
+
+ public static XpathListener initialize(DDBean parentDDBean, final ConfigPropertiesHelper.ConfigPropertiesSource configPropertiesSource, String configPropertyXPath, String configPropertyNameXPath) {
+ DDBean[] beans = parentDDBean.getChildBean(configPropertyXPath);
+ ConfigPropertySettings[] configs = new ConfigPropertySettings[beans.length];
+ Set xmlBeans = new HashSet(Arrays.asList(configPropertiesSource.getConfigPropertySettingArray()));
+ for (int i = 0; i < beans.length; i++) {
+ DDBean bean = beans[i];
+ String[] names = bean.getText(configPropertyNameXPath);
+ String name = names.length == 1 ? names[0] : "";
+ GerConfigPropertySettingType target = null;
+ for (Iterator it = xmlBeans.iterator(); it.hasNext();) {
+ GerConfigPropertySettingType setting = (GerConfigPropertySettingType) it.next();
+ if (setting.getName().equals(name)) {
+ target = setting;
+ xmlBeans.remove(target);
+ break;
+ }
+ }
+ if (target == null) {
+ target = configPropertiesSource.addNewConfigPropertySetting();
+ }
+ configs[i] = new ConfigPropertySettings();
+ configs[i].initialize(target, bean);
+ }
+ for (Iterator it = xmlBeans.iterator(); it.hasNext();) { // used to be in XmlBeans, no longer anything matching in J2EE DD
+ GerConfigPropertySettingType target = (GerConfigPropertySettingType) it.next();
+ GerConfigPropertySettingType[] xmlConfigs = configPropertiesSource.getConfigPropertySettingArray();
+ for (int i = 0; i < xmlConfigs.length; i++) {
+ if (xmlConfigs[i] == target) {
+ configPropertiesSource.removeConfigPropertySetting(i);
+ break;
+ }
+ }
+ }
+ configPropertiesSource.setConfigPropertySettings(configs);
+ XpathListener configListener = new XpathListener() {
+ public void fireXpathEvent(XpathEvent xpe) {
+ ConfigPropertySettings[] configs = configPropertiesSource.getConfigPropertySettings();
+ if (xpe.isAddEvent()) {
+ ConfigPropertySettings[] bigger = new ConfigPropertySettings[configs.length + 1];
+ System.arraycopy(configs, 0, bigger, 0, configs.length);
+ bigger[configs.length] = new ConfigPropertySettings();
+ bigger[configs.length].initialize(configPropertiesSource.addNewConfigPropertySetting(), xpe.getBean());
+ configPropertiesSource.setConfigPropertySettings(bigger);
+ } else if (xpe.isRemoveEvent()) {
+ int index = -1;
+ for (int i = 0; i < configs.length; i++) {
+ if (configs[i].matches(xpe.getBean())) {
+ // remove the XMLBean
+ GerConfigPropertySettingType[] xmlConfigs = configPropertiesSource.getConfigPropertySettingArray();
+ for (int j = 0; j < xmlConfigs.length; j++) {
+ GerConfigPropertySettingType test = xmlConfigs[j];
+ if (test == configs[i].getConfigPropertySetting()) {
+ configPropertiesSource.removeConfigPropertySetting(j);
+ break;
+ }
+ }
+ // clean up the JavaBean
+ configs[i].dispose();
+ index = i;
+ break;
+ }
+ }
+ // remove the JavaBean from my list
+ if (index > -1) {
+ ConfigPropertySettings[] smaller = new ConfigPropertySettings[configs.length - 1];
+ System.arraycopy(configs, 0, smaller, 0, index);
+ System.arraycopy(configs, index + 1, smaller, index, smaller.length - index);
+ configPropertiesSource.setConfigPropertySettings(smaller);
+ }
+ }
+ // ignore change event (no contents, no attributes)
+ }
+ };
+ parentDDBean.addXpathListener(configPropertyXPath, configListener);
+ return configListener;
+ }
+
+ public interface ConfigPropertiesSource {
+ GerConfigPropertySettingType[] getConfigPropertySettingArray();
+
+ GerConfigPropertySettingType addNewConfigPropertySetting();
+
+ void removeConfigPropertySetting(int j);
+
+ ConfigPropertySettings[] getConfigPropertySettings();
+
+ void setConfigPropertySettings(ConfigPropertySettings[] configs);
+ }
+}
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertiesHelper.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertiesHelper.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertiesHelper.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertySettingDConfigBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertySettingDConfigBean.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertySettingDConfigBean.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertySettingDConfigBean.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,74 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.geronimo.connector.deployment.dconfigbean;
+
+import javax.enterprise.deploy.model.DDBean;
+
+import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
+import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
+import org.apache.xmlbeans.SchemaTypeLoader;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ * */
+public class ConfigPropertySettingDConfigBean extends DConfigBeanSupport {
+
+ public ConfigPropertySettingDConfigBean(DDBean ddBean, GerConfigPropertySettingType configPropertySetting) {
+ super(ddBean, configPropertySetting);
+ String name = ddBean.getText("config-property-name")[0];
+ if (configPropertySetting.getName() == null) {
+ configPropertySetting.setName(name);
+ String[] values = ddBean.getText("config-property-value");
+ if (values != null && values.length == 1) {
+ configPropertySetting.setStringValue(values[0]);
+ }
+ } else {
+ assert name.equals(configPropertySetting.getName());
+ }
+ }
+
+ GerConfigPropertySettingType getConfigPropertySetting() {
+ return (GerConfigPropertySettingType) getXmlObject();
+ }
+
+ public String getConfigPropertyName() {
+ return getConfigPropertySetting().getName();
+ }
+
+ //TODO this needs research about if it works.
+ public String getConfigPropertyType() {
+ return getDDBean().getText("config-property/config-property-type")[0];
+ }
+
+ public String getConfigPropertyValue() {
+ return getConfigPropertySetting().getStringValue();
+ }
+
+ public void setConfigPropertyValue(String configPropertyValue) {
+ getConfigPropertySetting().setStringValue(configPropertyValue);
+ }
+
+ protected SchemaTypeLoader getSchemaTypeLoader() {
+ return ResourceAdapterDConfigRoot.SCHEMA_TYPE_LOADER;
+ }
+
+}
+
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertySettingDConfigBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertySettingDConfigBean.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertySettingDConfigBean.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertySettings.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertySettings.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertySettings.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertySettings.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,141 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.geronimo.connector.deployment.dconfigbean;
+
+import javax.enterprise.deploy.model.DDBean;
+import javax.enterprise.deploy.model.XpathEvent;
+import javax.enterprise.deploy.model.XpathListener;
+
+import org.apache.geronimo.deployment.plugin.XmlBeanSupport;
+import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
+import org.apache.xmlbeans.SchemaTypeLoader;
+import org.apache.xmlbeans.XmlBeans;
+
+/**
+ * @version $Revision 1.0$ $Date$
+ */
+public class ConfigPropertySettings extends XmlBeanSupport {
+ private final static SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.getContextTypeLoader();
+ private String type;
+ private DDBean ddBean;
+ private XpathListener typeListener;
+ private XpathListener nameListener;
+
+ public ConfigPropertySettings() {
+ super(null);
+ }
+
+ void initialize(GerConfigPropertySettingType xmlObject, DDBean configPropertyBean) {
+ setXmlObject(xmlObject);
+ ddBean = configPropertyBean;
+ DDBean[] child = configPropertyBean.getChildBean("config-property-type");
+ if (child.length == 1) {
+ setConfigPropertyType(child[0]);
+ }
+ child = configPropertyBean.getChildBean("config-property-name");
+ if (child.length == 1) {
+ setConfigPropertyName(child[0]);
+ }
+ configPropertyBean.addXpathListener("config-property-type", typeListener = new XpathListener() {
+ public void fireXpathEvent(XpathEvent xpe) {
+ if (xpe.isChangeEvent() || xpe.isAddEvent()) {
+ setConfigPropertyType(xpe.getBean());
+ } else if (xpe.isRemoveEvent()) {
+ setConfigPropertyType((String) null);
+ }
+ }
+ });
+ configPropertyBean.addXpathListener("config-property-name", nameListener = new XpathListener() {
+ public void fireXpathEvent(XpathEvent xpe) {
+ if (xpe.isChangeEvent() || xpe.isAddEvent()) {
+ setConfigPropertyName(xpe.getBean());
+ } else if (xpe.isRemoveEvent()) {
+ setConfigPropertyName((String) null);
+ }
+ }
+ });
+ }
+
+ boolean matches(DDBean target) {
+ return target.equals(ddBean);
+ }
+
+ void dispose() {
+ if (ddBean != null) {
+ ddBean.removeXpathListener("config-property-type", typeListener);
+ ddBean.removeXpathListener("config-property-name", nameListener);
+ }
+ nameListener = null;
+ typeListener = null;
+ ddBean = null;
+ }
+
+ GerConfigPropertySettingType getConfigPropertySetting() {
+ return (GerConfigPropertySettingType) getXmlObject();
+ }
+
+ public String getConfigPropertyName() {
+ return getConfigPropertySetting().getName();
+ }
+
+ private void setConfigPropertyName(DDBean configPropertyBean) {
+ if (configPropertyBean == null) {
+ setConfigPropertyName((String) null);
+ } else {
+ setConfigPropertyName(configPropertyBean.getText());
+ }
+ }
+
+ private void setConfigPropertyName(String name) {
+ String old = getConfigPropertyName();
+ getConfigPropertySetting().setName(name);
+ pcs.firePropertyChange("configPropertyName", old, name);
+ }
+
+ public String getConfigPropertyType() {
+ return type;
+ }
+
+ private void setConfigPropertyType(DDBean configPropertyBean) {
+ if (configPropertyBean == null) {
+ setConfigPropertyType((String) null);
+ } else {
+ setConfigPropertyType(configPropertyBean.getText());
+ }
+ }
+
+ private void setConfigPropertyType(String type) {
+ String old = getConfigPropertyType();
+ this.type = type;
+ pcs.firePropertyChange("configPropertyType", old, type);
+ }
+
+ public String getConfigPropertyValue() {
+ return getConfigPropertySetting().getStringValue();
+ }
+
+ public void setConfigPropertyValue(String configPropertyValue) {
+ String old = getConfigPropertyValue();
+ getConfigPropertySetting().setStringValue(configPropertyValue);
+ pcs.firePropertyChange("configPropertyValue", old, configPropertyValue);
+ }
+
+ public String toString() {
+ return "Property "+getConfigPropertyName();
+ }
+}
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertySettings.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertySettings.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConfigPropertySettings.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionDConfigBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionDConfigBean.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionDConfigBean.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionDConfigBean.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,102 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.geronimo.connector.deployment.dconfigbean;
+
+import javax.enterprise.deploy.model.DDBean;
+
+import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
+import org.apache.geronimo.xbeans.geronimo.GerConnectionDefinitionType;
+import org.apache.geronimo.xbeans.geronimo.GerConnectiondefinitionInstanceType;
+import org.apache.geronimo.xbeans.geronimo.GerConnectionmanagerType;
+import org.apache.xmlbeans.SchemaTypeLoader;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ *
+ **/
+public class ConnectionDefinitionDConfigBean extends DConfigBeanSupport {
+
+ private ConnectionDefinitionInstance[] instances = new ConnectionDefinitionInstance[0];
+
+ public ConnectionDefinitionDConfigBean(DDBean ddBean, GerConnectionDefinitionType connectionDefinition) {
+ super(ddBean, connectionDefinition);
+ String connectionfactoryInterface = ddBean.getText("connectionfactory-interface")[0];
+ if (connectionDefinition.getConnectionfactoryInterface() == null) {
+ connectionDefinition.setConnectionfactoryInterface(connectionfactoryInterface);
+ } else {
+ assert connectionfactoryInterface.equals(connectionDefinition.getConnectionfactoryInterface());
+ }
+ // Get initial list of instances
+ instances = new ConnectionDefinitionInstance[getConnectionDefinition().getConnectiondefinitionInstanceArray().length];
+ for (int i = 0; i < instances.length; i++) {
+ instances[i] = new ConnectionDefinitionInstance();
+ instances[i].initialize(getConnectionDefinition().getConnectiondefinitionInstanceArray(i), this);
+ }
+ }
+
+ GerConnectionDefinitionType getConnectionDefinition() {
+ return (GerConnectionDefinitionType) getXmlObject();
+ }
+
+ public ConnectionDefinitionInstance[] getConnectionDefinitionInstance() {
+ return instances;
+ }
+
+ public void setConnectionDefinitionInstance(ConnectionDefinitionInstance[] instances) {
+ ConnectionDefinitionInstance[] old = getConnectionDefinitionInstance();
+ this.instances = instances;
+ for (int i = 0; i < instances.length; i++) { // catch additions
+ ConnectionDefinitionInstance instance = instances[i];
+ if (!instance.hasParent()) {
+ GerConnectiondefinitionInstanceType xmlObject = getConnectionDefinition().addNewConnectiondefinitionInstance();
+ xmlObject.setConnectionmanager(GerConnectionmanagerType.Factory.newInstance());
+ instance.initialize(xmlObject, this);
+ }
+ }
+ for (int i = 0; i < old.length; i++) { // catch removals
+ ConnectionDefinitionInstance instance = old[i];
+ boolean found = false;
+ for (int j = 0; j < instances.length; j++) {
+ if (instances[j] == instance) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ // remove the XmlBean
+ for (int j = 0; j < getConnectionDefinition().getConnectiondefinitionInstanceArray().length; j++) {
+ GerConnectiondefinitionInstanceType test = getConnectionDefinition().getConnectiondefinitionInstanceArray(j);
+ if (test == instance.getConnectiondefinitionInstance()) {
+ getConnectionDefinition().removeConnectiondefinitionInstance(j);
+ break;
+ }
+ }
+ // clean up the removed JavaBean
+ instance.dispose();
+ }
+ }
+ pcs.firePropertyChange("connectionDefinitionInstance", old, instances);
+ }
+
+ protected SchemaTypeLoader getSchemaTypeLoader() {
+ return ResourceAdapterDConfigRoot.SCHEMA_TYPE_LOADER;
+ }
+
+}
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionDConfigBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionDConfigBean.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionDConfigBean.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionDConfigBeanBeanInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionDConfigBeanBeanInfo.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionDConfigBeanBeanInfo.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionDConfigBeanBeanInfo.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,153 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.connector.deployment.dconfigbean;
+
+import java.beans.*;
+import java.awt.*;
+
+/**
+ * @version $Revision: 1.0$
+ */
+public class ConnectionDefinitionDConfigBeanBeanInfo implements BeanInfo {
+ /**
+ * A bean may have a "default" event that is the event that will
+ * mostly commonly be used by humans when using the bean.
+ *
+ * @return Index of default event in the EventSetDescriptor array
+ * returned by getEventSetDescriptors.
+ * <P> Returns -1 if there is no default event.
+ */
+ public int getDefaultEventIndex() {
+ return -1;
+ }
+
+ /**
+ * A bean may have a "default" property that is the property that will
+ * mostly commonly be initially chosen for update by human's who are
+ * customizing the bean.
+ *
+ * @return Index of default property in the PropertyDescriptor array
+ * returned by getPropertyDescriptors.
+ * <P> Returns -1 if there is no default property.
+ */
+ public int getDefaultPropertyIndex() {
+ return -1;
+ }
+
+ /**
+ * This method returns an image object that can be used to
+ * represent the bean in toolboxes, toolbars, etc. Icon images
+ * will typically be GIFs, but may in future include other formats.
+ * <p/>
+ * Beans aren't required to provide icons and may return null from
+ * this method.
+ * <p/>
+ * There are four possible flavors of icons (16x16 color,
+ * 32x32 color, 16x16 mono, 32x32 mono). If a bean choses to only
+ * support a single icon we recommend supporting 16x16 color.
+ * <p/>
+ * We recommend that icons have a "transparent" background
+ * so they can be rendered onto an existing background.
+ *
+ * @param iconKind The kind of icon requested. This should be
+ * one of the constant values ICON_COLOR_16x16, ICON_COLOR_32x32,
+ * ICON_MONO_16x16, or ICON_MONO_32x32.
+ * @return An image object representing the requested icon. May
+ * return null if no suitable icon is available.
+ */
+ public Image getIcon(int iconKind) {
+ return null;
+ }
+
+ /**
+ * Gets the beans <code>BeanDescriptor</code>.
+ *
+ * @return A BeanDescriptor providing overall information about
+ * the bean, such as its displayName, its customizer, etc. May
+ * return null if the information should be obtained by automatic
+ * analysis.
+ */
+ public BeanDescriptor getBeanDescriptor() {
+ BeanDescriptor bd = new BeanDescriptor(ConnectionDefinitionDConfigBean.class);
+ bd.setDisplayName("Connection Definition");
+ bd.setShortDescription("Holds a list of connection instances available for this connector.");
+ return bd;
+ }
+
+ /**
+ * This method allows a BeanInfo object to return an arbitrary collection
+ * of other BeanInfo objects that provide additional information on the
+ * current bean.
+ * <P>
+ * If there are conflicts or overlaps between the information provided
+ * by different BeanInfo objects, then the current BeanInfo takes precedence
+ * over the getAdditionalBeanInfo objects, and later elements in the array
+ * take precedence over earlier ones.
+ *
+ * @return an array of BeanInfo objects. May return null.
+ */
+ public BeanInfo[] getAdditionalBeanInfo() {
+ return null;
+ }
+
+ /**
+ * Gets the beans <code>EventSetDescriptor</code>s.
+ *
+ * @return An array of EventSetDescriptors describing the kinds of
+ * events fired by this bean. May return null if the information
+ * should be obtained by automatic analysis.
+ */
+ public EventSetDescriptor[] getEventSetDescriptors() {
+ return null;
+ }
+
+ /**
+ * Gets the beans <code>MethodDescriptor</code>s.
+ *
+ * @return An array of MethodDescriptors describing the externally
+ * visible methods supported by this bean. May return null if
+ * the information should be obtained by automatic analysis.
+ */
+ public MethodDescriptor[] getMethodDescriptors() {
+ return null;
+ }
+
+ /**
+ * Gets the beans <code>PropertyDescriptor</code>s.
+ *
+ * @return An array of PropertyDescriptors describing the editable
+ * properties supported by this bean. May return null if the
+ * information should be obtained by automatic analysis.
+ * <p/>
+ * If a property is indexed, then its entry in the result array will
+ * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
+ * A client of getPropertyDescriptors can use "instanceof" to check
+ * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
+ */
+ public PropertyDescriptor[] getPropertyDescriptors() {
+ try {
+ PropertyDescriptor instances = new PropertyDescriptor("connectionDefinitionInstance", ConnectionDefinitionDConfigBean.class);
+ instances.setDisplayName("Geronimo Connections");
+ instances.setShortDescription("Geronimo allows several connection instances to be configured for the same connection type. For example, there may be connection instances pointing to several databases for a single JDBC instance of a connector.");
+ return new PropertyDescriptor[] {
+ instances
+ };
+ } catch (IntrospectionException e) {
+ throw new RuntimeException("Unable to parse bean", e);
+ }
+ }
+}
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionDConfigBeanBeanInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionDConfigBeanBeanInfo.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionDConfigBeanBeanInfo.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionInstance.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionInstance.java?rev=706357&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionInstance.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionInstance.java Mon Oct 20 11:23:36 2008
@@ -0,0 +1,219 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.geronimo.connector.deployment.dconfigbean;
+
+import javax.enterprise.deploy.model.DDBean;
+import javax.enterprise.deploy.model.XpathListener;
+
+import org.apache.geronimo.deployment.plugin.XmlBeanSupport;
+import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
+import org.apache.geronimo.xbeans.geronimo.GerConnectiondefinitionInstanceType;
+import org.apache.geronimo.xbeans.geronimo.GerConnectionmanagerType;
+import org.apache.xmlbeans.SchemaTypeLoader;
+import org.apache.xmlbeans.XmlBeans;
+
+/**
+ * @version $Revision 1.0$ $Date$
+ */
+public class ConnectionDefinitionInstance extends XmlBeanSupport {
+ private final static SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.getContextTypeLoader();
+ private ConfigPropertySettings[] configs = new ConfigPropertySettings[0];
+ private ConnectionDefinitionDConfigBean parent;
+ private XpathListener configListener;
+
+ public ConnectionDefinitionInstance() {
+ super(null);
+ }
+
+ void initialize(GerConnectiondefinitionInstanceType xmlObject, ConnectionDefinitionDConfigBean parent) {
+ setXmlObject(xmlObject);
+ this.parent = parent;
+ DDBean parentDDBean = parent.getDDBean();
+ configListener = ConfigPropertiesHelper.initialize(parentDDBean, new ConfigPropertiesHelper.ConfigPropertiesSource() {
+ public GerConfigPropertySettingType[] getConfigPropertySettingArray() {
+ return getConnectiondefinitionInstance().getConfigPropertySettingArray();
+ }
+
+ public GerConfigPropertySettingType addNewConfigPropertySetting() {
+ return getConnectiondefinitionInstance().addNewConfigPropertySetting();
+ }
+
+ public void removeConfigPropertySetting(int j) {
+ getConnectiondefinitionInstance().removeConfigPropertySetting(j);
+ }
+
+ public ConfigPropertySettings[] getConfigPropertySettings() {
+ return configs;
+ }
+
+ public void setConfigPropertySettings(ConfigPropertySettings[] configs) {
+ setConfigProperty(configs);
+ }
+
+ }, "config-property", "config-property-name");
+ }
+
+
+ boolean hasParent() {
+ return parent != null;
+ }
+
+ void dispose() {
+ if (configs != null) {
+ for (int i = 0; i < configs.length; i++) {
+ configs[i].dispose();
+ }
+ }
+ if (parent != null) {
+ parent.getDDBean().removeXpathListener("config-property", configListener);
+ }
+ configs = null;
+ configListener = null;
+ parent = null;
+ }
+
+// JavaBean properties for this object (with a couple helper methods)
+
+ GerConnectiondefinitionInstanceType getConnectiondefinitionInstance() {
+ return (GerConnectiondefinitionInstanceType) getXmlObject();
+ }
+
+ GerConnectionmanagerType getConnectionManager() {
+ return getConnectiondefinitionInstance().getConnectionmanager();
+ }
+
+ public ConfigPropertySettings[] getConfigProperty() {
+ return configs;
+ }
+
+ private void setConfigProperty(ConfigPropertySettings[] configs) { // can only be changed by adding a new DDBean
+ ConfigPropertySettings[] old = getConfigProperty();
+ this.configs = configs;
+ pcs.firePropertyChange("configProperty", old, configs);
+ }
+
+ public String getName() {
+ return getConnectiondefinitionInstance().getName();
+ }
+
+ public void setName(String name) {
+ String old = getName();
+ getConnectiondefinitionInstance().setName(name);
+ pcs.firePropertyChange("name", old, name);
+ }
+
+// public String getGlobalJNDIName() {
+// return getConnectiondefinitionInstance().getGlobalJndiName();
+// }
+//
+// public void setGlobalJNDIName(String globalJNDIName) {
+// String old = getGlobalJNDIName();
+// getConnectiondefinitionInstance().setGlobalJndiName(globalJNDIName);
+// pcs.firePropertyChange("globalJNDIName", old, globalJNDIName);
+// }
+
+// public boolean isUseConnectionRequestInfo() {
+// return getConnectionManager().getUseConnectionRequestInfo();
+// }
+//
+// public void setUseConnectionRequestInfo(boolean useConnectionRequestInfo) {
+// boolean old = isUseConnectionRequestInfo();
+// getConnectionManager().setUseConnectionRequestInfo(useConnectionRequestInfo);
+// pcs.firePropertyChange("useConnectionRequestInfo", old, useConnectionRequestInfo);
+// }
+//
+// public boolean isUseSubject() {
+// return getConnectionManager().getUseSubject();
+// }
+//
+// public void setUseSubject(boolean useSubject) {
+// boolean old = isUseSubject();
+// getConnectionManager().setUseSubject(useSubject);
+// pcs.firePropertyChange("useSubject", old, useSubject);
+// }
+//
+// public boolean isUseTransactionCaching() {
+// return getConnectionManager().getUseTransactionCaching();
+// }
+//
+// public void setUseTransactionCaching(boolean useTransactionCaching) {
+// boolean old = isUseTransactionCaching();
+// getConnectionManager().setUseTransactionCaching(useTransactionCaching);
+// pcs.firePropertyChange("useTransactionCaching", old, useTransactionCaching);
+// }
+//
+// public boolean isUseLocalTransactions() {
+// return getConnectionManager().getUseLocalTransactions();
+// }
+//
+// public void setUseLocalTransactions(boolean useLocalTransactions) {
+// boolean old = isUseLocalTransactions();
+// getConnectionManager().setUseLocalTransactions(useLocalTransactions);
+// pcs.firePropertyChange("useLocalTransactions", old, useLocalTransactions);
+// }
+//
+// public boolean isUseTransactions() {
+// return getConnectionManager().getUseTransactions();
+// }
+//
+// public void setUseTransactions(boolean useTransactions) {
+// boolean old = isUseTransactions();
+// getConnectionManager().setUseTransactions(useTransactions);
+// pcs.firePropertyChange("useTransactions", old, useTransactions);
+// }
+//
+// public int getMaxSize() {
+// BigInteger test = getConnectionManager().getMaxSize();
+// return test == null ? 0 : test.intValue();
+// }
+//
+// public void setMaxSize(int maxSize) {
+// int old = getMaxSize();
+// getConnectionManager().setMaxSize(BigInteger.valueOf(maxSize));
+// pcs.firePropertyChange("maxSize", old, maxSize);
+// }
+//
+// public int getBlockingTimeout() {
+// BigInteger test = getConnectionManager().getBlockingTimeout();
+// return test == null ? 0 : test.intValue();
+// }
+//
+// public void setBlockingTimeout(int blockingTimeout) {
+// int old = getBlockingTimeout();
+// getConnectionManager().setBlockingTimeout(BigInteger.valueOf(blockingTimeout));
+// pcs.firePropertyChange("blockingTimeout", old, blockingTimeout);
+// }
+
+ public boolean isContainerManagedSecurity() {
+ return getConnectionManager().isSetContainerManagedSecurity();
+ }
+
+ public void setContainerManagedSecurity(boolean containerManagedSecurity) {
+ boolean old = isContainerManagedSecurity();
+ if (old && !containerManagedSecurity) {
+ getConnectionManager().setContainerManagedSecurity(null);
+ } else if (!old && containerManagedSecurity) {
+ getConnectionManager().addNewContainerManagedSecurity();
+ }
+ pcs.firePropertyChange("containerManagedSecurity", old, containerManagedSecurity);
+ }
+
+ public String toString() {
+ return "Connection "+getName();
+ }
+}
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionInstance.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionInstance.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionInstance.java
------------------------------------------------------------------------------
svn:mime-type = text/plain