[jbossws-commits] JBossWS SVN: r16726 - in common/trunk/src/main/java/org/jboss/ws/common: deployment and 3 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Fri Sep 14 12:11:31 EDT 2012


Author: alessio.soldano at jboss.com
Date: 2012-09-14 12:11:31 -0400 (Fri, 14 Sep 2012)
New Revision: 16726

Modified:
   common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java
   common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java
   common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextPropertiesDeploymentAspect.java
   common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java
   common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java
   common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
   common/trunk/src/main/java/org/jboss/ws/common/monitoring/AbstractRecordProcessor.java
   common/trunk/src/main/java/org/jboss/ws/common/sort/DeploymentAspectSorter.java
   common/trunk/src/main/java/org/jboss/ws/common/utils/XMLPredefinedEntityReferenceResolver.java
Log:
Few minor changes on collections creation


Modified: common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java	2012-09-14 16:10:20 UTC (rev 16725)
+++ common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java	2012-09-14 16:11:31 UTC (rev 16726)
@@ -64,7 +64,7 @@
 {
    private static final ResourceBundle bundle = BundleUtils.getBundle(ConfigHelper.class);
    
-   private static Map<String, String> bindingIDs = new HashMap<String, String>();
+   private static Map<String, String> bindingIDs = new HashMap<String, String>(8);
    static {
       bindingIDs.put(SOAPBinding.SOAP11HTTP_BINDING, "##SOAP11_HTTP");
       bindingIDs.put(SOAPBinding.SOAP12HTTP_BINDING, "##SOAP12_HTTP");

Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java	2012-09-14 16:10:20 UTC (rev 16725)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java	2012-09-14 16:11:31 UTC (rev 16726)
@@ -69,12 +69,13 @@
    protected LifecycleHandler lifecycleHandler;
    protected EndpointMetrics metrics;
    protected String address;
-   protected List<RecordProcessor> recordProcessors = new Vector<RecordProcessor>();
+   protected List<RecordProcessor> recordProcessors = new Vector<RecordProcessor>(2);
    protected SecurityDomainContext securityDomainContext;
    protected InstanceProvider instanceProvider;
    
    AbstractDefaultEndpoint(String targetBean)
    {
+      super(8, 4);
       this.targetBean = targetBean;
       this.state = EndpointState.UNDEFINED;
    }

Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextPropertiesDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextPropertiesDeploymentAspect.java	2012-09-14 16:10:20 UTC (rev 16725)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextPropertiesDeploymentAspect.java	2012-09-14 16:11:31 UTC (rev 16726)
@@ -21,6 +21,7 @@
  */
 package org.jboss.ws.common.deployment;
 
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
@@ -43,9 +44,18 @@
       return contextProperties;
    }
 
+   /**
+    * This is called once at AS boot time during deployment aspect parsing;
+    * this provided map is copied.
+    * 
+    * @param contextProperties
+    */
    public void setContextProperties(Map<String, String> contextProperties)
    {
-      this.contextProperties = contextProperties;
+      if (contextProperties != null) {
+         this.contextProperties = new HashMap<String, String>(4);
+         this.contextProperties.putAll(contextProperties);
+      }
    }
 
    @Override

Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java	2012-09-14 16:10:20 UTC (rev 16725)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java	2012-09-14 16:11:31 UTC (rev 16726)
@@ -52,6 +52,7 @@
 
    DefaultDeployment(String name, ClassLoader classLoader)
    {
+      super(8, 4);
       simpleName = name;
       state = DeploymentState.UNDEFINED;
       initialLoader = classLoader;

Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java	2012-09-14 16:10:20 UTC (rev 16725)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java	2012-09-14 16:11:31 UTC (rev 16726)
@@ -1,6 +1,6 @@
 /*
  * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, 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.
  *
@@ -27,7 +27,6 @@
 import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.deployment.Endpoint;
 
-import java.util.Collection;
 import java.util.LinkedList;
 import java.util.List;
 
@@ -49,6 +48,7 @@
 
    DefaultService()
    {
+      super(4, 4);
    }
 
    public Deployment getDeployment()

Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java	2012-09-14 16:10:20 UTC (rev 16725)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java	2012-09-14 16:11:31 UTC (rev 16726)
@@ -39,6 +39,7 @@
 import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.deployment.Endpoint;
 import org.jboss.wsf.spi.deployment.HttpEndpoint;
+import org.jboss.wsf.spi.deployment.Service;
 import org.jboss.wsf.spi.management.ServerConfig;
 import org.jboss.wsf.spi.management.ServerConfigFactory;
 import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
@@ -60,15 +61,16 @@
    @Override
    public void start(Deployment dep)
    {
-      String contextRoot = dep.getService().getContextRoot();
+      final Service service = dep.getService();
+      String contextRoot = service.getContextRoot();
       if (contextRoot == null)
          throw new IllegalStateException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_CONTEXT_ROOT"));
       
       // TODO: remove this hack - review API
-      String protocol = (String)dep.getService().getProperty("protocol");
-      String host = (String)dep.getService().getProperty("host");
+      String protocol = (String)service.getProperty("protocol");
+      String host = (String)service.getProperty("host");
       
-      PortValue port = new PortValue((Integer)dep.getService().getProperty("port"), null);
+      PortValue port = new PortValue((Integer)service.getProperty("port"), null);
       
       if (protocol == null)
       {
@@ -81,7 +83,7 @@
       }
       Map<String, Endpoint> endpointsMap = new HashMap<String, Endpoint>();
       List<Endpoint> deleteList = new LinkedList<Endpoint>();
-      for (Endpoint ep : dep.getService().getEndpoints())
+      for (Endpoint ep : service.getEndpoints())
       {
          if (ep instanceof HttpEndpoint)
          {
@@ -116,7 +118,7 @@
       //Remove endpoints with duplicated address
       for (Endpoint ep : deleteList)
       {
-         dep.getService().getEndpoints().remove(ep);
+         service.getEndpoints().remove(ep);
       }
    }
    

Modified: common/trunk/src/main/java/org/jboss/ws/common/monitoring/AbstractRecordProcessor.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/monitoring/AbstractRecordProcessor.java	2012-09-14 16:10:20 UTC (rev 16725)
+++ common/trunk/src/main/java/org/jboss/ws/common/monitoring/AbstractRecordProcessor.java	2012-09-14 16:11:31 UTC (rev 16726)
@@ -37,7 +37,7 @@
  */
 public abstract class AbstractRecordProcessor implements RecordProcessor
 {
-   protected List<RecordFilter> filters = new Vector<RecordFilter>();
+   protected List<RecordFilter> filters = new Vector<RecordFilter>(1);
    protected boolean processDestinationHost = true;
    protected boolean processSourceHost = true;
    protected boolean processHeaders = true;

Modified: common/trunk/src/main/java/org/jboss/ws/common/sort/DeploymentAspectSorter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/sort/DeploymentAspectSorter.java	2012-09-14 16:10:20 UTC (rev 16725)
+++ common/trunk/src/main/java/org/jboss/ws/common/sort/DeploymentAspectSorter.java	2012-09-14 16:11:31 UTC (rev 16726)
@@ -21,6 +21,7 @@
  */
 package org.jboss.ws.common.sort;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -98,9 +99,11 @@
    {
       private Map<String, Dependency> dependencies = new HashMap<String, Dependency>();
       private Set<Vertex> vertices = new HashSet<Vertex>();
+      private int size = 0;
 
       public void addVertex(final DeploymentAspect aspect)
       {
+         size++;
          // create disjunct sets
          final Set<String> inputs = new HashSet<String>();
          inputs.addAll(aspect.getRequiresAsSet());
@@ -136,7 +139,7 @@
       public List<DeploymentAspect> sort()
       {
          // L ← Empty list that will contain the sorted elements
-         List<DeploymentAspect> retVal = new LinkedList<DeploymentAspect>();
+         List<DeploymentAspect> retVal = new ArrayList<DeploymentAspect>(size);
          // S ← Set of all nodes with no incoming edges
          List<Vertex> roots = this.getRoots();
 

Modified: common/trunk/src/main/java/org/jboss/ws/common/utils/XMLPredefinedEntityReferenceResolver.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/utils/XMLPredefinedEntityReferenceResolver.java	2012-09-14 16:10:20 UTC (rev 16725)
+++ common/trunk/src/main/java/org/jboss/ws/common/utils/XMLPredefinedEntityReferenceResolver.java	2012-09-14 16:11:31 UTC (rev 16726)
@@ -34,7 +34,7 @@
 public class XMLPredefinedEntityReferenceResolver
 {
    private static final ResourceBundle bundle = BundleUtils.getBundle(XMLPredefinedEntityReferenceResolver.class);
-   private static HashMap<String, Character> entities = new HashMap<String, Character>();
+   private static HashMap<String, Character> entities = new HashMap<String, Character>(8);
 
    static
    {



More information about the jbossws-commits mailing list