You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by he...@apache.org on 2004/09/21 14:30:49 UTC
svn commit: rev 46979 - webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry
Author: hemapani
Date: Tue Sep 21 05:30:49 2004
New Revision: 46979
Added:
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/CommonExecuterState.java
webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/CommonExecuterStateFactory.java
Log:
split the state and logic from the common executers so all the instances of the one type (e.g all the instance of transport) share a one state and they are stateless expect for that. This will make the pooling possible
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/CommonExecuterState.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/CommonExecuterState.java Tue Sep 21 05:30:49 2004
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed 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.axis.registry;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author hemapani@opensource.lk
+ */
+public class CommonExecuterState {
+ //the work is delegated to ConcreateXXInclude classes
+ protected FlowInclude flowInclude;
+ protected ModuleInclude modules;
+ protected TypeMappingInclude typemappings;
+
+ /**
+ *
+ */
+ public CommonExecuterState() {
+
+ flowInclude = new ConcreateFlowInclude();
+ modules = new ConcreateModuleInclude();
+ typemappings = new ConcreateTypeMappingInclude();
+ }
+ /**
+ * @return
+ */
+ public Flow getFaultFlow() {
+ return flowInclude.getFaultFlow();
+ }
+
+ /**
+ * @return
+ */
+ public Flow getInFlow() {
+ return flowInclude.getInFlow();
+ }
+
+ /**
+ * @return
+ */
+ public Flow getOutFlow() {
+ return flowInclude.getOutFlow();
+ }
+
+ /**
+ * @param flow
+ */
+ public synchronized void setFaultFlow(Flow flow) {
+ flowInclude.setFaultFlow(flow);
+ }
+
+ /**
+ * @param flow
+ */
+ public synchronized void setInFlow(Flow flow) {
+ flowInclude.setInFlow(flow);
+ }
+
+ /**
+ * @param flow
+ */
+ public synchronized void setOutFlow(Flow flow) {
+ flowInclude.setOutFlow(flow);
+ }
+
+ /**
+ * @param typeMapping
+ */
+ public void addTypeMapping(TypeMapping typeMapping) {
+ typemappings.addTypeMapping(typeMapping);
+ }
+
+ /**
+ * @param javaType
+ * @return
+ */
+ public TypeMapping getTypeMapping(Class javaType) {
+ return typemappings.getTypeMapping(javaType);
+ }
+
+ /**
+ * @param index
+ * @return
+ */
+ public TypeMapping getTypeMapping(int index) {
+ return typemappings.getTypeMapping(index);
+ }
+
+ /**
+ * @param xmlType
+ * @return
+ */
+ public TypeMapping getTypeMapping(QName xmlType) {
+ return typemappings.getTypeMapping(xmlType);
+ }
+
+ /**
+ * @return
+ */
+ public int getTypeMappingCount() {
+ return typemappings.getTypeMappingCount();
+ }
+
+ /**
+ * @param module
+ */
+ public synchronized void addModule(Module module) {
+ modules.addModule(module);
+ }
+
+ /**
+ * @param index
+ * @return
+ */
+ public Module getModule(int index) {
+ return modules.getModule(index);
+ }
+
+ /**
+ * @return
+ */
+ public int getModuleCount() {
+ return modules.getModuleCount();
+ }
+
+
+}
Added: webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/CommonExecuterStateFactory.java
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/srinath_eran_jaliya/src/java/org/apache/axis/registry/CommonExecuterStateFactory.java Tue Sep 21 05:30:49 2004
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed 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.axis.registry;
+
+/**
+ * <p> This make sure all the CommonExecuters of given type in the pool share a common state.
+ * Changing one will affet all. e.g. All the Transport instances share a comman state.</p>
+ *
+ * @author hemapani@opensource.lk
+ *
+ */
+public class CommonExecuterStateFactory {
+ private static CommonExecuterState serviceState;
+ private static CommonExecuterState operationState;
+ private static CommonExecuterState transportState;
+ private static CommonExecuterState globalState;
+
+ public static CommonExecuterState getServiceState(){
+ if(serviceState == null)
+ return new CommonExecuterState();
+ return serviceState;
+
+ }
+ public static CommonExecuterState getTrasportState(){
+ if(transportState == null)
+ return new CommonExecuterState();
+ return transportState;
+
+ }
+ public static CommonExecuterState getGlobalState(){
+ if(globalState == null)
+ return new CommonExecuterState();
+ return globalState;
+
+ }
+ public static CommonExecuterState getOperationState(){
+ if(operationState == null)
+ return new CommonExecuterState();
+ return operationState;
+
+ }
+
+}