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 aj...@apache.org on 2005/04/08 08:09:05 UTC

svn commit: r160517 - in webservices/axis/trunk/java/modules/core/src/org/apache/axis/context: AxisContext.java ContextBag.java EngineContext.java MEPContext.java ModuleContext.java OperationContext.java ServiceContext.java

Author: ajith
Date: Thu Apr  7 23:09:04 2005
New Revision: 160517

URL: http://svn.apache.org/viewcvs?view=rev&rev=160517
Log:
Adding the new contexts. Note - Still not complete!

Added:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/AxisContext.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ContextBag.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContext.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MEPContext.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ModuleContext.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContext.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ServiceContext.java

Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/AxisContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/AxisContext.java?view=auto&rev=160517
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/AxisContext.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/AxisContext.java Thu Apr  7 23:09:04 2005
@@ -0,0 +1,83 @@
+package org.apache.axis.context;
+
+import java.io.Serializable;
+import java.util.HashMap;
+
+/*
+ * Copyright 2004,2005 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.
+ *
+ * 
+ */
+public abstract class AxisContext implements Serializable{
+    
+    protected transient HashMap nonPersistentMap;
+    protected HashMap persistentMap;
+
+    protected AxisContext() {
+        this.persistentMap = new HashMap();
+        this.nonPersistentMap = new HashMap();
+    }
+
+    /**
+     * Store an object. depending on the persistent flag the
+     * object is either saved in the persistent way or the non-persistent
+     * way
+     * @param key
+     * @param value
+     * @param persistent
+     */
+    public void put(Object key,Object value,boolean persistent){
+        if (persistent){
+            persistentMap.put(key,value);
+        }else{
+            nonPersistentMap.put(key,value);
+        }
+    }
+
+    /**
+     * Store an object with the default persistent flag.
+     * default is no persistance
+     * @param key
+     * @param value
+     */
+    public void put(Object key,Object value){
+        this.put(key,value,false);
+    }
+     /**
+      * Retrieve an object. Default search is done in the non persistent
+      * group
+      * @param key
+      * @return
+      */
+    public Object get(Object key){
+       return this.get(key,false); //todo Do we need to have the default search extended to
+                                         //todo search the persistent map as well
+    }
+
+    /**
+     *
+     * @param key
+     * @param persistent
+     * @return
+     */
+    public Object get(Object key,boolean persistent){
+        if (persistent){
+            return persistentMap.get(key);
+        }else{
+            return nonPersistentMap.get(key);
+        }
+    }
+
+}

Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ContextBag.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ContextBag.java?view=auto&rev=160517
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ContextBag.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ContextBag.java Thu Apr  7 23:09:04 2005
@@ -0,0 +1,68 @@
+package org.apache.axis.context;
+
+/*
+ * Copyright 2004,2005 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.
+ *
+ * 
+ */
+public class ContextBag {
+
+    private EngineContext engineContext;
+    private ServiceContext serviceContext;
+    private OperationContext operationContext;
+    private MEPContext mepContext;
+    private MessageContext messageContext;
+
+    public EngineContext getEngineContext() {
+        return engineContext;
+    }
+
+    public void setEngineContext(EngineContext engineContext) {
+        this.engineContext = engineContext;
+    }
+
+    public ServiceContext getServiceContext() {
+        return serviceContext;
+    }
+
+    public void setServiceContext(ServiceContext serviceContext) {
+        this.serviceContext = serviceContext;
+    }
+
+    public OperationContext getOperationContext() {
+        return operationContext;
+    }
+
+    public void setOperationContext(OperationContext operationContext) {
+        this.operationContext = operationContext;
+    }
+
+    public MEPContext getMepContext() {
+        return mepContext;
+    }
+
+    public void setMepContext(MEPContext mepContext) {
+        this.mepContext = mepContext;
+    }
+
+    public MessageContext getMessageContext() {
+        return messageContext;
+    }
+
+    public void setMessageContext(MessageContext messageContext) {
+        this.messageContext = messageContext;
+    }
+
+}

Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContext.java?view=auto&rev=160517
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContext.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContext.java Thu Apr  7 23:09:04 2005
@@ -0,0 +1,39 @@
+package org.apache.axis.context;
+
+/*
+ * Copyright 2004,2005 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.
+ *
+ *  Runtime state of the engine
+ */
+
+import org.apache.axis.context.AxisContext;
+
+import java.util.Map;
+
+public class EngineContext extends AxisContext{
+
+    //private EngineConfiguration engineConfig;
+    private Map serviceContextMap;
+    private Map sessionContextMap;
+    private Map moduleContextMap;
+
+    
+
+
+
+
+
+
+}

Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MEPContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MEPContext.java?view=auto&rev=160517
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MEPContext.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MEPContext.java Thu Apr  7 23:09:04 2005
@@ -0,0 +1,65 @@
+package org.apache.axis.context;
+
+/*
+ * Copyright 2004,2005 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.
+ *
+ * 
+ */
+
+import org.apache.axis.context.AxisContext;
+
+import java.util.Map;
+import java.util.HashMap;
+
+public class MEPContext  extends AxisContext{
+    private Map messageContextMap;
+    private String mepId;
+
+    public String getMepId() {
+        return mepId;
+    }
+
+    public void setMepId(String mepId) {
+        this.mepId = mepId;
+    }
+
+    public MEPContext() {
+        super();
+        messageContextMap = new HashMap();
+    }
+
+    /**
+     *
+     * @param ctxt
+     */
+    public void addMessageContext(MessageContext ctxt){
+         messageContextMap.put(ctxt.getMessageID(),ctxt);
+    }
+
+    /**
+     *
+     * @param messageId
+     * @return
+     */
+    public MessageContext getMessageContext(String messageId){
+        return (MessageContext)messageContextMap.get(messageId);
+    }
+
+
+    public MessageContext removeMessageContext(MessageContext ctxt){
+        messageContextMap.remove(ctxt.getMessageID());
+        return ctxt;
+    }
+}

Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ModuleContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ModuleContext.java?view=auto&rev=160517
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ModuleContext.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ModuleContext.java Thu Apr  7 23:09:04 2005
@@ -0,0 +1,31 @@
+package org.apache.axis.context;
+
+/*
+ * Copyright 2004,2005 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.
+ *
+ * 
+ */
+public class ModuleContext extends AxisContext{
+    private String moduleId;
+
+    public String getModuleId() {
+        return moduleId;
+    }
+
+    public void setModuleId(String moduleId) {
+        this.moduleId = moduleId;
+    }
+
+}

Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContext.java?view=auto&rev=160517
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContext.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContext.java Thu Apr  7 23:09:04 2005
@@ -0,0 +1,56 @@
+package org.apache.axis.context;
+
+/*
+ * Copyright 2004,2005 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.
+ *
+ * 
+ */
+
+import org.apache.axis.context.AxisContext;
+
+import java.util.Map;
+import java.util.HashMap;
+
+public class OperationContext extends AxisContext{
+    private Map mepContextMap;
+    private String opId;
+
+   
+    public String getOpId() {
+        return opId;
+    }
+
+    public void setOpId(String opId) {
+        this.opId = opId;
+    }
+
+    public OperationContext() {
+        super();
+        this.mepContextMap = new HashMap();
+    }
+
+    public void addMepContext(MEPContext ctxt){
+        this.mepContextMap.put(ctxt.getMepId(),ctxt);
+    }
+
+    public MEPContext getMepContext(String mepId){
+        return (MEPContext)mepContextMap.get(mepId);
+    }
+
+    public MEPContext removeMepContext(MEPContext ctxt){
+        mepContextMap.remove(ctxt.getMepId());
+        return ctxt;
+    }
+}

Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ServiceContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ServiceContext.java?view=auto&rev=160517
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ServiceContext.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ServiceContext.java Thu Apr  7 23:09:04 2005
@@ -0,0 +1,48 @@
+package org.apache.axis.context;
+
+/*
+ * Copyright 2004,2005 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.
+ *
+ * 
+ */
+
+import org.apache.axis.context.AxisContext;
+
+import java.util.Map;
+import java.util.HashMap;
+
+public class ServiceContext  extends AxisContext{
+    private Map operationContextMap;
+
+    public ServiceContext() {
+        super();
+        this.operationContextMap = new HashMap();
+    }
+
+    public void addOperationContext(OperationContext ctxt){
+        this.operationContextMap.put(ctxt.getOpId(),ctxt);
+    }
+
+    public OperationContext getOperationContext(String opId){
+        return (OperationContext)operationContextMap.get(opId);
+    }
+
+    public OperationContext removeOperationContext(OperationContext ctxt){
+        operationContextMap.remove(ctxt.getOpId());
+        return ctxt;
+    }
+
+
+}