You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2005/09/15 21:07:03 UTC
svn commit: r289289 [18/134] - in /webservices/axis2/trunk/java: ./ etc/
modules/addressing/ modules/addressing/src/META-INF/
modules/addressing/src/org/apache/axis2/handlers/addressing/
modules/addressing/test-resources/ modules/addressing/test/org/ap...
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java Thu Sep 15 11:52:11 2005
@@ -1,139 +1,139 @@
-/*
-* 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.
-*/
-package org.apache.axis2.engine;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.OperationContext;
-import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.description.HandlerDescription;
-import org.apache.axis2.description.OperationDescription;
-import org.apache.axis2.description.ServiceDescription;
-import org.apache.axis2.handlers.AbstractHandler;
-
-import javax.xml.namespace.QName;
-
-/**
- * This the base class for all dispatchers, it is a Handler which has a one
- * traget, that is to find the Service a given SOAP message is targeted to.
- * <p/>
- * Axis2 service dispatching is model via a Chain of diapatchers, each trying to
- * Diaptach but let go without throwing a execption in case they fail.
- */
-public abstract class AbstractDispatcher extends AbstractHandler {
- /**
- * Field NAME
- */
- public static final QName NAME =
- new QName("http://axis.ws.apache.org",
- "AddressingBasedDispatcher");
-
- /**
- * Constructor Dispatcher
- */
- private ConfigurationContext engineContext;
-
- public AbstractDispatcher() {
- init(new HandlerDescription(NAME));
- }
-
- //just to put the parent
- public abstract void initDispatcher();
-
- /**
- * This is final, obivously not for overiding
- *
- * @param msgctx
- * @throws org.apache.axis2.AxisFault
- */
- public final void invoke(MessageContext msgctx) throws AxisFault {
-
- // first check we can dispatch using the relates to
- if (msgctx.getRelatesTo() != null) {
- String relatesTo = msgctx.getRelatesTo().getValue();
- if (relatesTo != null || "".equals(relatesTo)) {
- OperationContext operationContext = msgctx.getSystemContext().getOperationContext(relatesTo);
- if (operationContext != null) {
- msgctx.setOperationDescription(operationContext.getAxisOperation());
- msgctx.setOperationContext(operationContext);
- msgctx.setServiceContext((ServiceContext) operationContext.getParent());
- msgctx.setServiceDescription(((ServiceContext) operationContext.getParent()).getServiceConfig());
- }
- }
- return;
- }
-
-
- ServiceDescription serviceDescription = msgctx.getServiceDescription();
- if (serviceDescription == null) {
- serviceDescription = findService(msgctx);
- if (serviceDescription != null) {
- msgctx.setServiceDescription(serviceDescription);
- // TODO Chinthaka : set the Service Group Context to the message Context
- }
- }
-
- if (msgctx.getServiceDescription() != null && msgctx.getOperationDescription() == null) {
- OperationDescription operationDescription = findOperation(serviceDescription, msgctx);
- if (operationDescription != null) {
- msgctx.setOperationDescription(operationDescription);
- }
- }
-
-// if (msgctx.getServiceContext() == null) {
-// ServiceDescription axisService = findService(msgctx);
-// if (axisService != null) {
-// msgctx.setServiceContext(
-// axisService.findServiceContext(msgctx));
-// }
-// }
-//
-// if (msgctx.getServiceContext() != null &&
-// msgctx.getOperationContext() == null) {
-// OperationDescription axisOperation = findOperation(
-// msgctx.getServiceContext().getServiceConfig(), msgctx);
-// if (axisOperation != null) {
-// OperationContext operationContext = axisOperation.findOperationContext(
-// msgctx, msgctx.getServiceContext());
-// msgctx.setOperationContext(operationContext);
-// }
-// }
-
- }
-
- /**
- * Give the diaptacher turn to find the Service
- *
- * @param messageContext
- * @return
- * @throws AxisFault
- */
- public abstract ServiceDescription findService(
- MessageContext messageContext) throws AxisFault;
-
- /**
- * Give the diaptacher turn to find the Operation
- *
- * @param service
- * @param messageContext
- * @return
- * @throws AxisFault
- */
- public abstract OperationDescription findOperation(
- ServiceDescription service, MessageContext messageContext) throws AxisFault;
-
-}
+/*
+* 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.
+*/
+package org.apache.axis2.engine;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.description.OperationDescription;
+import org.apache.axis2.description.ServiceDescription;
+import org.apache.axis2.handlers.AbstractHandler;
+
+import javax.xml.namespace.QName;
+
+/**
+ * This the base class for all dispatchers, it is a Handler which has a one
+ * traget, that is to find the Service a given SOAP message is targeted to.
+ * <p/>
+ * Axis2 service dispatching is model via a Chain of diapatchers, each trying to
+ * Diaptach but let go without throwing a execption in case they fail.
+ */
+public abstract class AbstractDispatcher extends AbstractHandler {
+ /**
+ * Field NAME
+ */
+ public static final QName NAME =
+ new QName("http://axis.ws.apache.org",
+ "AddressingBasedDispatcher");
+
+ /**
+ * Constructor Dispatcher
+ */
+ private ConfigurationContext engineContext;
+
+ public AbstractDispatcher() {
+ init(new HandlerDescription(NAME));
+ }
+
+ //just to put the parent
+ public abstract void initDispatcher();
+
+ /**
+ * This is final, obivously not for overiding
+ *
+ * @param msgctx
+ * @throws org.apache.axis2.AxisFault
+ */
+ public final void invoke(MessageContext msgctx) throws AxisFault {
+
+ // first check we can dispatch using the relates to
+ if (msgctx.getRelatesTo() != null) {
+ String relatesTo = msgctx.getRelatesTo().getValue();
+ if (relatesTo != null || "".equals(relatesTo)) {
+ OperationContext operationContext = msgctx.getSystemContext().getOperationContext(relatesTo);
+ if (operationContext != null) {
+ msgctx.setOperationDescription(operationContext.getAxisOperation());
+ msgctx.setOperationContext(operationContext);
+ msgctx.setServiceContext((ServiceContext) operationContext.getParent());
+ msgctx.setServiceDescription(((ServiceContext) operationContext.getParent()).getServiceConfig());
+ }
+ }
+ return;
+ }
+
+
+ ServiceDescription serviceDescription = msgctx.getServiceDescription();
+ if (serviceDescription == null) {
+ serviceDescription = findService(msgctx);
+ if (serviceDescription != null) {
+ msgctx.setServiceDescription(serviceDescription);
+ // TODO Chinthaka : set the Service Group Context to the message Context
+ }
+ }
+
+ if (msgctx.getServiceDescription() != null && msgctx.getOperationDescription() == null) {
+ OperationDescription operationDescription = findOperation(serviceDescription, msgctx);
+ if (operationDescription != null) {
+ msgctx.setOperationDescription(operationDescription);
+ }
+ }
+
+// if (msgctx.getServiceContext() == null) {
+// ServiceDescription axisService = findService(msgctx);
+// if (axisService != null) {
+// msgctx.setServiceContext(
+// axisService.findServiceContext(msgctx));
+// }
+// }
+//
+// if (msgctx.getServiceContext() != null &&
+// msgctx.getOperationContext() == null) {
+// OperationDescription axisOperation = findOperation(
+// msgctx.getServiceContext().getServiceConfig(), msgctx);
+// if (axisOperation != null) {
+// OperationContext operationContext = axisOperation.findOperationContext(
+// msgctx, msgctx.getServiceContext());
+// msgctx.setOperationContext(operationContext);
+// }
+// }
+
+ }
+
+ /**
+ * Give the diaptacher turn to find the Service
+ *
+ * @param messageContext
+ * @return
+ * @throws AxisFault
+ */
+ public abstract ServiceDescription findService(
+ MessageContext messageContext) throws AxisFault;
+
+ /**
+ * Give the diaptacher turn to find the Operation
+ *
+ * @param service
+ * @param messageContext
+ * @return
+ * @throws AxisFault
+ */
+ public abstract OperationDescription findOperation(
+ ServiceDescription service, MessageContext messageContext) throws AxisFault;
+
+}
Propchange: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AbstractDispatcher.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java Thu Sep 15 11:52:11 2005
@@ -1,87 +1,87 @@
-/*
-* 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.
-*/
-package org.apache.axis2.engine;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.AddressingConstants;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.HandlerDescription;
-import org.apache.axis2.description.OperationDescription;
-import org.apache.axis2.description.ServiceDescription;
-import org.apache.axis2.util.Utils;
-
-import javax.xml.namespace.QName;
-
-/**
- * Dispatcher based on the WS-Addressing properties
- */
-public class AddressingBasedDispatcher extends AbstractDispatcher implements AddressingConstants {
- /**
- * Field NAME
- */
- public static final QName NAME =
- new QName("http://axis.ws.apache.org",
- "AddressingBasedDispatcher");
-
-// public AddressingBasedDispatcher() {
-// init(new HandlerDescription(NAME));
-// }
-
- public void initDispatcher() {
- init(new HandlerDescription(NAME));
- }
-
- //TODO this logic needed to be improved, as the Dispatching is almost garentnee to fail
- public OperationDescription findOperation(ServiceDescription service,
- MessageContext messageContext)
- throws AxisFault {
- String action = messageContext.getWSAAction();
- if (action != null) {
- QName operationName = new QName(action);
- return service.getOperation(operationName);
- }
-
-
- return null;
- }
-
- // TODO this logic needed to be improved, as the Dispatching is almost garentnee to fail
- public ServiceDescription findService(MessageContext messageContext) throws AxisFault {
- EndpointReference toEPR = messageContext.getTo();
- ServiceDescription service = null;
- if (toEPR != null) {
- String address = toEPR.getAddress();
- if (Final.WSA_ANONYMOUS_URL.equals(address) || Submission.WSA_ANONYMOUS_URL.equals(address)) {
- return null;
- }
- QName serviceName = new QName(address);
-
- String filePart = toEPR.getAddress();
- String[] values = Utils.parseRequestURLForServiceAndOperation(
- filePart);
- if (values[0] != null) {
- serviceName = new QName(values[0]);
- AxisConfiguration registry =
- messageContext.getSystemContext().getAxisConfiguration();
- return registry.getService(serviceName.getLocalPart());
-
- }
- }
- return service;
- }
-
-}
+/*
+* 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.
+*/
+package org.apache.axis2.engine;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.description.OperationDescription;
+import org.apache.axis2.description.ServiceDescription;
+import org.apache.axis2.util.Utils;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Dispatcher based on the WS-Addressing properties
+ */
+public class AddressingBasedDispatcher extends AbstractDispatcher implements AddressingConstants {
+ /**
+ * Field NAME
+ */
+ public static final QName NAME =
+ new QName("http://axis.ws.apache.org",
+ "AddressingBasedDispatcher");
+
+// public AddressingBasedDispatcher() {
+// init(new HandlerDescription(NAME));
+// }
+
+ public void initDispatcher() {
+ init(new HandlerDescription(NAME));
+ }
+
+ //TODO this logic needed to be improved, as the Dispatching is almost garentnee to fail
+ public OperationDescription findOperation(ServiceDescription service,
+ MessageContext messageContext)
+ throws AxisFault {
+ String action = messageContext.getWSAAction();
+ if (action != null) {
+ QName operationName = new QName(action);
+ return service.getOperation(operationName);
+ }
+
+
+ return null;
+ }
+
+ // TODO this logic needed to be improved, as the Dispatching is almost garentnee to fail
+ public ServiceDescription findService(MessageContext messageContext) throws AxisFault {
+ EndpointReference toEPR = messageContext.getTo();
+ ServiceDescription service = null;
+ if (toEPR != null) {
+ String address = toEPR.getAddress();
+ if (Final.WSA_ANONYMOUS_URL.equals(address) || Submission.WSA_ANONYMOUS_URL.equals(address)) {
+ return null;
+ }
+ QName serviceName = new QName(address);
+
+ String filePart = toEPR.getAddress();
+ String[] values = Utils.parseRequestURLForServiceAndOperation(
+ filePart);
+ if (values[0] != null) {
+ serviceName = new QName(values[0]);
+ AxisConfiguration registry =
+ messageContext.getSystemContext().getAxisConfiguration();
+ return registry.getService(serviceName.getLocalPart());
+
+ }
+ }
+ return service;
+ }
+
+}
Propchange: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java Thu Sep 15 11:52:11 2005
@@ -1,147 +1,147 @@
-/*
- * 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.
- */
-package org.apache.axis2.engine;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.description.*;
-import org.apache.axis2.storage.AxisStorage;
-
-import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-/**
- * The palce where all the Global states of Axis is kept.
- * All the Global states kept in the <code>EngineRegistry</code> and all the
- * Service states kept in the <code>MessageContext</code>. Other runtime
- * artifacts does not keep states foward from the execution.
- */
-public interface AxisConfiguration extends ParameterInclude {
- /**
- * Field INFLOW
- */
- public static final int INFLOW = 10003;
-
- /**
- * Field OUTFLOW
- */
- public static final int OUTFLOW = 10004;
-
- /**
- * Field FAULT_IN_FLOW
- */
- public static final int FAULT_IN_FLOW = 10005;
-
- public static final int FAULT_OUT_FLOW = 10006;
-
- /**
-<<<<<<< .mine
- * Method getService
- *
- * @param name
- * @return
- * @throws AxisFault
- */
- public ServiceDescription getService(String name) throws AxisFault;
-
- /**
- * Method addService
- *
- * @param service
- * @throws AxisFault
- */
- public void addService(ServiceDescription service) throws AxisFault;
-
- //to Add service Groups
- public void addServiceGroup(ServiceGroupDescription serviceGroup);
-
- /**
- * Method removeService
- *
- * @param name
- * @throws AxisFault
- */
- public void removeService(String name) throws AxisFault;
-
- /**
- * Modules is read only as they can not deployed while runing
- *
- * @param name
- * @return
- */
- public ModuleDescription getModule(QName name);
-
- /**
- * Method addMdoule
- *
- * @param module
- * @throws AxisFault
- */
- public void addModule(ModuleDescription module) throws AxisFault;
-
- public boolean isEngaged(QName moduleName);
-
- /**
- * To engage a module at the run time it can be used this method
- *
- * @param moduleref
- * @throws AxisFault
- */
- public void engageModule(QName moduleref) throws AxisFault;
-
-
-
- //
- public HashMap getServices();
- /**
- * This returns
- */
- public ArrayList getInPhasesUptoAndIncludingPostDispatch();
-
- public ArrayList getInFaultFlow();
-
- public Hashtable getFaultyServices();
-
- public Hashtable getFaultyModules();
-
- public TransportInDescription getTransportIn(QName name) throws AxisFault;
-
- public void addTransportIn(TransportInDescription transport) throws AxisFault;
-
- public TransportOutDescription getTransportOut(QName name) throws AxisFault;
-
- public void addTransportOut(TransportOutDescription transport) throws AxisFault;
-
- public HashMap getTransportsIn();
-
- public HashMap getTransportsOut();
-
- //to get and set Axis2 storges (the class which should handle storeg)
- public void setAxisStorage(AxisStorage axisStorage);
-
- public AxisStorage getAxisStorage();
-
- //to check whether a given paramter is locked
- public boolean isParamterLocked(String paramterName);
-
- public ServiceGroupDescription getServiceGroup(String serviceNameAndGroupString);
-
- Iterator getServiceGroups();
-
- public void notifyObservers(int event_type , ServiceDescription service);
-}
+/*
+ * 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.
+ */
+package org.apache.axis2.engine;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.description.*;
+import org.apache.axis2.storage.AxisStorage;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+/**
+ * The palce where all the Global states of Axis is kept.
+ * All the Global states kept in the <code>EngineRegistry</code> and all the
+ * Service states kept in the <code>MessageContext</code>. Other runtime
+ * artifacts does not keep states foward from the execution.
+ */
+public interface AxisConfiguration extends ParameterInclude {
+ /**
+ * Field INFLOW
+ */
+ public static final int INFLOW = 10003;
+
+ /**
+ * Field OUTFLOW
+ */
+ public static final int OUTFLOW = 10004;
+
+ /**
+ * Field FAULT_IN_FLOW
+ */
+ public static final int FAULT_IN_FLOW = 10005;
+
+ public static final int FAULT_OUT_FLOW = 10006;
+
+ /**
+<<<<<<< .mine
+ * Method getService
+ *
+ * @param name
+ * @return
+ * @throws AxisFault
+ */
+ public ServiceDescription getService(String name) throws AxisFault;
+
+ /**
+ * Method addService
+ *
+ * @param service
+ * @throws AxisFault
+ */
+ public void addService(ServiceDescription service) throws AxisFault;
+
+ //to Add service Groups
+ public void addServiceGroup(ServiceGroupDescription serviceGroup);
+
+ /**
+ * Method removeService
+ *
+ * @param name
+ * @throws AxisFault
+ */
+ public void removeService(String name) throws AxisFault;
+
+ /**
+ * Modules is read only as they can not deployed while runing
+ *
+ * @param name
+ * @return
+ */
+ public ModuleDescription getModule(QName name);
+
+ /**
+ * Method addMdoule
+ *
+ * @param module
+ * @throws AxisFault
+ */
+ public void addModule(ModuleDescription module) throws AxisFault;
+
+ public boolean isEngaged(QName moduleName);
+
+ /**
+ * To engage a module at the run time it can be used this method
+ *
+ * @param moduleref
+ * @throws AxisFault
+ */
+ public void engageModule(QName moduleref) throws AxisFault;
+
+
+
+ //
+ public HashMap getServices();
+ /**
+ * This returns
+ */
+ public ArrayList getInPhasesUptoAndIncludingPostDispatch();
+
+ public ArrayList getInFaultFlow();
+
+ public Hashtable getFaultyServices();
+
+ public Hashtable getFaultyModules();
+
+ public TransportInDescription getTransportIn(QName name) throws AxisFault;
+
+ public void addTransportIn(TransportInDescription transport) throws AxisFault;
+
+ public TransportOutDescription getTransportOut(QName name) throws AxisFault;
+
+ public void addTransportOut(TransportOutDescription transport) throws AxisFault;
+
+ public HashMap getTransportsIn();
+
+ public HashMap getTransportsOut();
+
+ //to get and set Axis2 storges (the class which should handle storeg)
+ public void setAxisStorage(AxisStorage axisStorage);
+
+ public AxisStorage getAxisStorage();
+
+ //to check whether a given paramter is locked
+ public boolean isParamterLocked(String paramterName);
+
+ public ServiceGroupDescription getServiceGroup(String serviceNameAndGroupString);
+
+ Iterator getServiceGroups();
+
+ public void notifyObservers(int event_type , ServiceDescription service);
+}
Propchange: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java Thu Sep 15 11:52:11 2005
@@ -1,592 +1,592 @@
-/*
-* 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.
-*/
-package org.apache.axis2.engine;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
-import org.apache.axis2.InstanceDispatcher;
-import org.apache.axis2.deployment.DeploymentEngine;
-import org.apache.axis2.deployment.repository.util.ArchiveReader;
-import org.apache.axis2.deployment.util.PhasesInfo;
-import org.apache.axis2.description.*;
-import org.apache.axis2.phaseresolver.PhaseMetadata;
-import org.apache.axis2.phaseresolver.PhaseResolver;
-import org.apache.axis2.storage.AxisStorage;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.xml.namespace.QName;
-import java.io.File;
-import java.util.*;
-
-/**
- * Class EngineRegistryImpl
- */
-public class AxisConfigurationImpl implements AxisConfiguration {
- /**
- * To store faulty services
- */
- private Hashtable faultyServices;
-
- private HashMap moduleConfigmap;
-
- //to keep axis2 storage class
- private AxisStorage axisStorage;
-
- private Hashtable faultyModules;
- private Log log = LogFactory.getLog(getClass());
-
- /**
- * Field modules
- */
- private final HashMap modules = new HashMap();
-
- /**
- * Field services
- */
-// private final HashMap services = new HashMap();
-
- private final HashMap serviceGroups = new HashMap();
- private final HashMap transportsIn = new HashMap();
-
- private final HashMap transportsOut = new HashMap();
-
- /**
- * Field phases
- */
- // private ArrayList inPhases;
- private ArrayList outPhases;
- private ArrayList inFaultPhases;
- private ArrayList outFaultPhases;
-
- private ArrayList inPhasesUptoAndIncludingPostDispatch;
-
-
-
- /////////////////////// From AxisGlobal /////////////////////////////////////
- /**
- * Field paramInclude
- */
- protected final ParameterInclude paramInclude;
-
-
- protected PhasesInfo phasesinfo;
-
- /**
- * Field modules
- */
- protected final List engagedModules;
-
- private String axis2Repository = null;
-
- //to store AxisObserver Objects
- private ArrayList observersList = null;
-
- private HashMap allservices = new HashMap();
-
-
- protected HashMap messagReceivers;
- /////////////////////// From AxisGlobal /////////////////////////////////////
- /**
- * Constructor EngineRegistryImpl
- */
- public AxisConfigurationImpl() {
- paramInclude = new ParameterIncludeImpl();
- engagedModules = new ArrayList();
- messagReceivers = new HashMap();
-
- outPhases = new ArrayList();
- inFaultPhases = new ArrayList();
- outFaultPhases = new ArrayList();
- faultyServices = new Hashtable();
- faultyModules = new Hashtable();
- observersList = new ArrayList();
-
- inPhasesUptoAndIncludingPostDispatch = new ArrayList();
- inPhasesUptoAndIncludingPostDispatch.add(
- new Phase(PhaseMetadata.PHASE_TRANSPORTIN));
- inPhasesUptoAndIncludingPostDispatch.add(
- new Phase(PhaseMetadata.PHASE_PRE_DISPATCH));
-
-// Phase dispatch = new Phase(PhaseMetadata.PHASE_DISPATCH);
-// AddressingBasedDispatcher add_dispatch = new AddressingBasedDispatcher();
-// add_dispatch.getHandlerDesc().setParent(this);
-// dispatch.addHandler(add_dispatch, 0);
-//
-// RequestURIBasedDispatcher uri_diaptch = new RequestURIBasedDispatcher();
-// uri_diaptch.getHandlerDesc().setParent(this);
-// dispatch.addHandler(uri_diaptch, 1);
-//
-// SOAPActionBasedDispatcher soapActionBased_dispatch = new SOAPActionBasedDispatcher();
-// soapActionBased_dispatch.getHandlerDesc().setParent(this);
-// dispatch.addHandler(soapActionBased_dispatch, 2);
-//
-// SOAPMessageBodyBasedDispatcher soapMessageBodybased_dispatch =
-// new SOAPMessageBodyBasedDispatcher();
-// soapMessageBodybased_dispatch.getHandlerDesc().setParent(this);
-// dispatch.addHandler(soapMessageBodybased_dispatch, 3);
-//
-// inPhasesUptoAndIncludingPostDispatch.add(dispatch);
-//
-// Phase postDispatch = new Phase(PhaseMetadata.PHASE_POST_DISPATCH);
-// DispatchingChecker dispatchingChecker = new DispatchingChecker();
-// dispatchingChecker.getHandlerDesc().setParent(this);
-//
-// postDispatch.addHandler(dispatchingChecker);
-// inPhasesUptoAndIncludingPostDispatch.add(postDispatch);
- }
-
-
- /**
- * setting the default dispatching order
- */
- public void setDefaultDispatchers(){
-
- Phase dispatch = new Phase(PhaseMetadata.PHASE_DISPATCH);
- AddressingBasedDispatcher add_dispatch = new AddressingBasedDispatcher();
- add_dispatch.initDispatcher();
- add_dispatch.getHandlerDesc().setParent(this);
- dispatch.addHandler(add_dispatch, 0);
-
- RequestURIBasedDispatcher uri_diaptch = new RequestURIBasedDispatcher();
- uri_diaptch.getHandlerDesc().setParent(this);
- uri_diaptch.initDispatcher();
- dispatch.addHandler(uri_diaptch, 1);
-
- SOAPActionBasedDispatcher soapActionBased_dispatch = new SOAPActionBasedDispatcher();
- soapActionBased_dispatch.getHandlerDesc().setParent(this);
- soapActionBased_dispatch.initDispatcher();
- dispatch.addHandler(soapActionBased_dispatch, 2);
-
- SOAPMessageBodyBasedDispatcher soapMessageBodybased_dispatch =
- new SOAPMessageBodyBasedDispatcher();
- soapMessageBodybased_dispatch.getHandlerDesc().setParent(this);
- soapMessageBodybased_dispatch.initDispatcher();
- dispatch.addHandler(soapMessageBodybased_dispatch, 3);
-
- inPhasesUptoAndIncludingPostDispatch.add(dispatch);
-
- Phase postDispatch = new Phase(PhaseMetadata.PHASE_POST_DISPATCH);
-
- DispatchingChecker dispatchingChecker = new DispatchingChecker();
- dispatchingChecker.getHandlerDesc().setParent(this);
-
- InstanceDispatcher instanceDispatcher = new InstanceDispatcher();
- instanceDispatcher.getHandlerDesc().setParent(this);
-
- postDispatch.addHandler(dispatchingChecker,0);
- postDispatch.addHandler(instanceDispatcher,1);
- inPhasesUptoAndIncludingPostDispatch.add(postDispatch);
- }
-
-
- /**
- * Setting the custom dispatching order
- * @param dispatch
- */
- public void setDispatchPhase(Phase dispatch){
- inPhasesUptoAndIncludingPostDispatch.add(dispatch);
- Phase postDispatch = new Phase(PhaseMetadata.PHASE_POST_DISPATCH);
- DispatchingChecker dispatchingChecker = new DispatchingChecker();
- dispatchingChecker.getHandlerDesc().setParent(this);
-
- postDispatch.addHandler(dispatchingChecker);
- inPhasesUptoAndIncludingPostDispatch.add(postDispatch);
- }
-
-
- public Hashtable getFaultyServices() {
- return faultyServices;
- }
-
- public Hashtable getFaultyModules() {
- return faultyModules;
- }
-
- /**
- * Method addMdoule
- *
- * @param module
- * @throws AxisFault
- */
- public synchronized void addModule(ModuleDescription module) throws AxisFault {
- module.setParent(this);
- modules.put(module.getName(), module);
- }
-
- /**
- * Method addService
- *
- * @param service
- * @throws AxisFault
- */
- public synchronized void addService(ServiceDescription service) throws AxisFault {
- ServiceGroupDescription serviceGroup = new ServiceGroupDescription();
- serviceGroup.setServiceGroupName(service.getName().getLocalPart());
- serviceGroup.setParent(this);
- serviceGroup.addService(service);
- addServiceGroup(serviceGroup);
- }
-
- public void addServiceGroup(ServiceGroupDescription serviceGroup){
- serviceGroups.put(serviceGroup.getServiceGroupName(),serviceGroup);
- Iterator services = serviceGroup.getServices();
- while (services.hasNext()) {
- ServiceDescription description = (ServiceDescription) services.next();
- notifyObservers(AxisEvent.SERVICE_DEPLOY ,description);
- }
- }
-
- /**
- * Method getModule
- *
- * @param name
- * @return ModuleDescription
- */
- public ModuleDescription getModule(QName name) {
- return (ModuleDescription) modules.get(name);
- }
-
- /**
- * @return HashMap
- */
- public HashMap getModules() {
- return modules;
- }
- /**
- * Method getService
- *
- * @param name
- * @return
- * @throws AxisFault
- */
- public ServiceDescription getService(String name) throws AxisFault {
- String [] nameParts = splitServiceName(name);
- ServiceGroupDescription sg = getServiceGroup(nameParts[0]);
- if(sg == null){
- return null;
- } else {
- String servicName = nameParts[1];
- ServiceDescription service = sg.getService(new QName(servicName));
- if(service == null){
- return null;
- } else {
- return service;
- }
- }
- }
-
- /**
- * Method removeService
- *
- * @param name
- * @throws AxisFault
- */
- public synchronized void removeService(String name) throws AxisFault {
- String [] nameParts = splitServiceName(name);
- ServiceGroupDescription sg = getServiceGroup(nameParts[0]);
- if(sg != null){
- sg.removeService(new QName(nameParts[1]));
- }
- }
-
- public TransportInDescription getTransportIn(QName name) throws AxisFault {
- return (TransportInDescription) transportsIn.get(name);
- }
-
- /**
- * Method addTransport
- *
- * @param transport
- * @throws AxisFault
- */
- public synchronized void addTransportIn(TransportInDescription transport)
- throws AxisFault {
- transportsIn.put(transport.getName(), transport);
- }
-
- public TransportOutDescription getTransportOut(QName name) throws AxisFault {
- return (TransportOutDescription) transportsOut.get(name);
- }
-
- /**
- * Method addTransport
- *
- * @param transport
- * @throws AxisFault
- */
- public synchronized void addTransportOut(TransportOutDescription transport)
- throws AxisFault {
- transportsOut.put(transport.getName(), transport);
- }
-
- public HashMap getTransportsIn() {
- return transportsIn;
- }
-
- public HashMap getTransportsOut() {
- return transportsOut;
- }
-
- //to get and set Axis2 storges (the class which should handle storeg)
- public void setAxisStorage(AxisStorage axisStorage) {
- this.axisStorage =axisStorage;
- }
-
- public AxisStorage getAxisStorage() {
- return axisStorage;
- }
-
- //to check whether a given paramter is locked
- public boolean isParamterLocked(String paramterName) {
- Parameter parameter = getParameter(paramterName);
- return parameter != null && parameter.isLocked();
- }
-
- public ServiceGroupDescription getServiceGroup(String serviceNameAndGroupString) {
- String serviceGroup [] = splitServiceName(serviceNameAndGroupString);
- return (ServiceGroupDescription)serviceGroups.get(serviceGroup[0]);
- }
-
- public Iterator getServiceGroups() {
- return serviceGroups.values().iterator();
- }
-
- public void setOutPhases(ArrayList outPhases) {
- this.outPhases = outPhases;
- }
-
-
- public ArrayList getInPhasesUptoAndIncludingPostDispatch() {
- return inPhasesUptoAndIncludingPostDispatch;
- }
-
- public ArrayList getOutFlow() {
- return outPhases;
- }
-
-
- /**
- <<<<<<< .mine
- * @return ArrayList
- =======
- >>>>>>> .r280753
- */
- public ArrayList getInFaultFlow() {
- return inFaultPhases;
- }
-
- /**
- <<<<<<< .mine
- * @return ArrayList
- =======
- >>>>>>> .r280753
- */
- public ArrayList getOutFaultFlow() {
- return outFaultPhases;
- }
-
- /**
- * @param list
- */
- public void setInFaultPhases(ArrayList list) {
- inFaultPhases = list;
- }
-
- /**
- * @param list
- */
- public void setOutFaultPhases(ArrayList list) {
- outFaultPhases = list;
- }
-
- ////////////////////////// Form Axis Global
-
- public void addMessageReceiver(String key,
- MessageReceiver messageReceiver) {
- messagReceivers.put(key, messageReceiver);
- }
-
- public MessageReceiver getMessageReceiver(String key) {
- return (MessageReceiver) messagReceivers.get(key);
- }
-
- /**
- * Method getParameter
- *
- * @param name
- <<<<<<< .mine
- * @return Parameter
- =======
- >>>>>>> .r280753
- */
- public Parameter getParameter(String name) {
- return paramInclude.getParameter(name);
- }
-
- public ArrayList getParameters() {
- return paramInclude.getParameters();
- }
-
- /**
- * Method addParameter
- *
- * @param param
- */
- public void addParameter(Parameter param) throws AxisFault{
- if(isParamterLocked(param.getName())){
- throw new AxisFault("Parmter is locked can not overide: " + param.getName());
- } else{
- paramInclude.addParameter(param);
- }
- }
-
- /**
- * Method getEngadgedModules
- *
- <<<<<<< .mine
- * @return Collection
- =======
- >>>>>>> .r280753
- */
- public Collection getEngadgedModules() {
- return engagedModules;
- }
-
- public void engageModule(QName moduleref) throws AxisFault {
- ModuleDescription module = getModule(moduleref);
- boolean isNewmodule = false;
- boolean tobeEnaged = true;
- if (module == null) {
- File file = new ArchiveReader().creatModuleArchivefromResource(
- moduleref.getLocalPart(), getRepository());
- module = new DeploymentEngine().buildModule(file);
- isNewmodule = true;
- }
- if (module != null) {
- for (Iterator iterator = engagedModules.iterator();
- iterator.hasNext();) {
- QName qName = (QName) iterator.next();
- if (moduleref.equals(qName)) {
- tobeEnaged = false;
- //Instead of throwing the error, we can just log this problem
- log.info("Attempt to engage an already engaged module "+ qName);
-// throw new AxisFault(moduleref.getLocalPart() +
-// " module has alredy engaged globally" +
-// " operation terminated !!!");
- }
- }
- } else {
- throw new AxisFault(
- this + " Refer to invalid module "
- + moduleref.getLocalPart() +
- " has not bean deployed yet !");
- }
- if (tobeEnaged) {
- new PhaseResolver(this).engageModuleGlobally(module);
- engagedModules.add(moduleref);
- }
- if (isNewmodule) {
- addModule(module);
- }
- }
-
- //to get all the services in the system
- public HashMap getServices() {
- Iterator sgs = getServiceGroups();
- while (sgs.hasNext()) {
- ServiceGroupDescription groupDescription = (ServiceGroupDescription) sgs.next();
- Iterator servics = groupDescription.getServices();
- while (servics.hasNext()) {
- ServiceDescription serviceDescription = (ServiceDescription) servics.next();
- allservices.put(serviceDescription.getName().getLocalPart(),serviceDescription);
- }
- }
- return allservices;
- }
-
- public boolean isEngaged(QName moduleName) {
- return engagedModules.contains(moduleName);
- }
-
- public PhasesInfo getPhasesinfo() {
- return phasesinfo;
- }
-
- public void setPhasesinfo(PhasesInfo phasesinfo) {
- this.phasesinfo = phasesinfo;
- }
-
- public String getRepository() {
- return axis2Repository;
- }
-
- public void setRepository(String axis2Repository) {
- this.axis2Repository = axis2Repository;
- }
-
- public void notifyObservers(int event_type , ServiceDescription service){
- AxisEvent event = new AxisEvent(service,event_type);
- for (int i = 0; i < observersList.size(); i++) {
- AxisObserver axisObserver = (AxisObserver) observersList.get(i);
- axisObserver.update(event);
- }
- }
-
- public void addObservers(AxisObserver axisObserver){
- observersList.add(axisObserver);
- }
-
-
- /**
- * Adding module configuration , if there is moduleConfig tag in service
- * @param moduleConfiguration
- */
- public void addModuleConfig(ModuleConfiguration moduleConfiguration){
- if(moduleConfigmap == null){
- moduleConfigmap = new HashMap();
- }
- moduleConfigmap.put(moduleConfiguration.getModuleName(),moduleConfiguration);
- }
-
- public ModuleConfiguration getModuleConfig(QName moduleName){
- return (ModuleConfiguration)moduleConfigmap.get(moduleName);
- }
-
-
- /**
- * To split a given service name into it serviceGroupName and Service Name
- * if the service Name is foo:bar then serviceGroupName ="foo" and ServiceName ="bar"
- * but if the service name is only the foo we asume ServiceGroupName="foo" ans ServiceName="foo"
- * meaning foo := foo:foo
- * @param serviceName
- * @return String [] <code>String</code>
- */
- public static String [] splitServiceName(String serviceName){
- String namePart [] = new String[2];
- int index = serviceName.indexOf(Constants.SERVICE_NAME_SPLIT_CHAR);
- if(index > 0){
- namePart[0] = serviceName.substring(0,index);
- namePart[1] = serviceName.substring(index +1 ,serviceName.length());
- } else {
- namePart[0] = serviceName;
- namePart[1] = serviceName;
- }
- return namePart;
- }
-
-
-}
+/*
+* 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.
+*/
+package org.apache.axis2.engine;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.InstanceDispatcher;
+import org.apache.axis2.deployment.DeploymentEngine;
+import org.apache.axis2.deployment.repository.util.ArchiveReader;
+import org.apache.axis2.deployment.util.PhasesInfo;
+import org.apache.axis2.description.*;
+import org.apache.axis2.phaseresolver.PhaseMetadata;
+import org.apache.axis2.phaseresolver.PhaseResolver;
+import org.apache.axis2.storage.AxisStorage;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.xml.namespace.QName;
+import java.io.File;
+import java.util.*;
+
+/**
+ * Class EngineRegistryImpl
+ */
+public class AxisConfigurationImpl implements AxisConfiguration {
+ /**
+ * To store faulty services
+ */
+ private Hashtable faultyServices;
+
+ private HashMap moduleConfigmap;
+
+ //to keep axis2 storage class
+ private AxisStorage axisStorage;
+
+ private Hashtable faultyModules;
+ private Log log = LogFactory.getLog(getClass());
+
+ /**
+ * Field modules
+ */
+ private final HashMap modules = new HashMap();
+
+ /**
+ * Field services
+ */
+// private final HashMap services = new HashMap();
+
+ private final HashMap serviceGroups = new HashMap();
+ private final HashMap transportsIn = new HashMap();
+
+ private final HashMap transportsOut = new HashMap();
+
+ /**
+ * Field phases
+ */
+ // private ArrayList inPhases;
+ private ArrayList outPhases;
+ private ArrayList inFaultPhases;
+ private ArrayList outFaultPhases;
+
+ private ArrayList inPhasesUptoAndIncludingPostDispatch;
+
+
+
+ /////////////////////// From AxisGlobal /////////////////////////////////////
+ /**
+ * Field paramInclude
+ */
+ protected final ParameterInclude paramInclude;
+
+
+ protected PhasesInfo phasesinfo;
+
+ /**
+ * Field modules
+ */
+ protected final List engagedModules;
+
+ private String axis2Repository = null;
+
+ //to store AxisObserver Objects
+ private ArrayList observersList = null;
+
+ private HashMap allservices = new HashMap();
+
+
+ protected HashMap messagReceivers;
+ /////////////////////// From AxisGlobal /////////////////////////////////////
+ /**
+ * Constructor EngineRegistryImpl
+ */
+ public AxisConfigurationImpl() {
+ paramInclude = new ParameterIncludeImpl();
+ engagedModules = new ArrayList();
+ messagReceivers = new HashMap();
+
+ outPhases = new ArrayList();
+ inFaultPhases = new ArrayList();
+ outFaultPhases = new ArrayList();
+ faultyServices = new Hashtable();
+ faultyModules = new Hashtable();
+ observersList = new ArrayList();
+
+ inPhasesUptoAndIncludingPostDispatch = new ArrayList();
+ inPhasesUptoAndIncludingPostDispatch.add(
+ new Phase(PhaseMetadata.PHASE_TRANSPORTIN));
+ inPhasesUptoAndIncludingPostDispatch.add(
+ new Phase(PhaseMetadata.PHASE_PRE_DISPATCH));
+
+// Phase dispatch = new Phase(PhaseMetadata.PHASE_DISPATCH);
+// AddressingBasedDispatcher add_dispatch = new AddressingBasedDispatcher();
+// add_dispatch.getHandlerDesc().setParent(this);
+// dispatch.addHandler(add_dispatch, 0);
+//
+// RequestURIBasedDispatcher uri_diaptch = new RequestURIBasedDispatcher();
+// uri_diaptch.getHandlerDesc().setParent(this);
+// dispatch.addHandler(uri_diaptch, 1);
+//
+// SOAPActionBasedDispatcher soapActionBased_dispatch = new SOAPActionBasedDispatcher();
+// soapActionBased_dispatch.getHandlerDesc().setParent(this);
+// dispatch.addHandler(soapActionBased_dispatch, 2);
+//
+// SOAPMessageBodyBasedDispatcher soapMessageBodybased_dispatch =
+// new SOAPMessageBodyBasedDispatcher();
+// soapMessageBodybased_dispatch.getHandlerDesc().setParent(this);
+// dispatch.addHandler(soapMessageBodybased_dispatch, 3);
+//
+// inPhasesUptoAndIncludingPostDispatch.add(dispatch);
+//
+// Phase postDispatch = new Phase(PhaseMetadata.PHASE_POST_DISPATCH);
+// DispatchingChecker dispatchingChecker = new DispatchingChecker();
+// dispatchingChecker.getHandlerDesc().setParent(this);
+//
+// postDispatch.addHandler(dispatchingChecker);
+// inPhasesUptoAndIncludingPostDispatch.add(postDispatch);
+ }
+
+
+ /**
+ * setting the default dispatching order
+ */
+ public void setDefaultDispatchers(){
+
+ Phase dispatch = new Phase(PhaseMetadata.PHASE_DISPATCH);
+ AddressingBasedDispatcher add_dispatch = new AddressingBasedDispatcher();
+ add_dispatch.initDispatcher();
+ add_dispatch.getHandlerDesc().setParent(this);
+ dispatch.addHandler(add_dispatch, 0);
+
+ RequestURIBasedDispatcher uri_diaptch = new RequestURIBasedDispatcher();
+ uri_diaptch.getHandlerDesc().setParent(this);
+ uri_diaptch.initDispatcher();
+ dispatch.addHandler(uri_diaptch, 1);
+
+ SOAPActionBasedDispatcher soapActionBased_dispatch = new SOAPActionBasedDispatcher();
+ soapActionBased_dispatch.getHandlerDesc().setParent(this);
+ soapActionBased_dispatch.initDispatcher();
+ dispatch.addHandler(soapActionBased_dispatch, 2);
+
+ SOAPMessageBodyBasedDispatcher soapMessageBodybased_dispatch =
+ new SOAPMessageBodyBasedDispatcher();
+ soapMessageBodybased_dispatch.getHandlerDesc().setParent(this);
+ soapMessageBodybased_dispatch.initDispatcher();
+ dispatch.addHandler(soapMessageBodybased_dispatch, 3);
+
+ inPhasesUptoAndIncludingPostDispatch.add(dispatch);
+
+ Phase postDispatch = new Phase(PhaseMetadata.PHASE_POST_DISPATCH);
+
+ DispatchingChecker dispatchingChecker = new DispatchingChecker();
+ dispatchingChecker.getHandlerDesc().setParent(this);
+
+ InstanceDispatcher instanceDispatcher = new InstanceDispatcher();
+ instanceDispatcher.getHandlerDesc().setParent(this);
+
+ postDispatch.addHandler(dispatchingChecker,0);
+ postDispatch.addHandler(instanceDispatcher,1);
+ inPhasesUptoAndIncludingPostDispatch.add(postDispatch);
+ }
+
+
+ /**
+ * Setting the custom dispatching order
+ * @param dispatch
+ */
+ public void setDispatchPhase(Phase dispatch){
+ inPhasesUptoAndIncludingPostDispatch.add(dispatch);
+ Phase postDispatch = new Phase(PhaseMetadata.PHASE_POST_DISPATCH);
+ DispatchingChecker dispatchingChecker = new DispatchingChecker();
+ dispatchingChecker.getHandlerDesc().setParent(this);
+
+ postDispatch.addHandler(dispatchingChecker);
+ inPhasesUptoAndIncludingPostDispatch.add(postDispatch);
+ }
+
+
+ public Hashtable getFaultyServices() {
+ return faultyServices;
+ }
+
+ public Hashtable getFaultyModules() {
+ return faultyModules;
+ }
+
+ /**
+ * Method addMdoule
+ *
+ * @param module
+ * @throws AxisFault
+ */
+ public synchronized void addModule(ModuleDescription module) throws AxisFault {
+ module.setParent(this);
+ modules.put(module.getName(), module);
+ }
+
+ /**
+ * Method addService
+ *
+ * @param service
+ * @throws AxisFault
+ */
+ public synchronized void addService(ServiceDescription service) throws AxisFault {
+ ServiceGroupDescription serviceGroup = new ServiceGroupDescription();
+ serviceGroup.setServiceGroupName(service.getName().getLocalPart());
+ serviceGroup.setParent(this);
+ serviceGroup.addService(service);
+ addServiceGroup(serviceGroup);
+ }
+
+ public void addServiceGroup(ServiceGroupDescription serviceGroup){
+ serviceGroups.put(serviceGroup.getServiceGroupName(),serviceGroup);
+ Iterator services = serviceGroup.getServices();
+ while (services.hasNext()) {
+ ServiceDescription description = (ServiceDescription) services.next();
+ notifyObservers(AxisEvent.SERVICE_DEPLOY ,description);
+ }
+ }
+
+ /**
+ * Method getModule
+ *
+ * @param name
+ * @return ModuleDescription
+ */
+ public ModuleDescription getModule(QName name) {
+ return (ModuleDescription) modules.get(name);
+ }
+
+ /**
+ * @return HashMap
+ */
+ public HashMap getModules() {
+ return modules;
+ }
+ /**
+ * Method getService
+ *
+ * @param name
+ * @return
+ * @throws AxisFault
+ */
+ public ServiceDescription getService(String name) throws AxisFault {
+ String [] nameParts = splitServiceName(name);
+ ServiceGroupDescription sg = getServiceGroup(nameParts[0]);
+ if(sg == null){
+ return null;
+ } else {
+ String servicName = nameParts[1];
+ ServiceDescription service = sg.getService(new QName(servicName));
+ if(service == null){
+ return null;
+ } else {
+ return service;
+ }
+ }
+ }
+
+ /**
+ * Method removeService
+ *
+ * @param name
+ * @throws AxisFault
+ */
+ public synchronized void removeService(String name) throws AxisFault {
+ String [] nameParts = splitServiceName(name);
+ ServiceGroupDescription sg = getServiceGroup(nameParts[0]);
+ if(sg != null){
+ sg.removeService(new QName(nameParts[1]));
+ }
+ }
+
+ public TransportInDescription getTransportIn(QName name) throws AxisFault {
+ return (TransportInDescription) transportsIn.get(name);
+ }
+
+ /**
+ * Method addTransport
+ *
+ * @param transport
+ * @throws AxisFault
+ */
+ public synchronized void addTransportIn(TransportInDescription transport)
+ throws AxisFault {
+ transportsIn.put(transport.getName(), transport);
+ }
+
+ public TransportOutDescription getTransportOut(QName name) throws AxisFault {
+ return (TransportOutDescription) transportsOut.get(name);
+ }
+
+ /**
+ * Method addTransport
+ *
+ * @param transport
+ * @throws AxisFault
+ */
+ public synchronized void addTransportOut(TransportOutDescription transport)
+ throws AxisFault {
+ transportsOut.put(transport.getName(), transport);
+ }
+
+ public HashMap getTransportsIn() {
+ return transportsIn;
+ }
+
+ public HashMap getTransportsOut() {
+ return transportsOut;
+ }
+
+ //to get and set Axis2 storges (the class which should handle storeg)
+ public void setAxisStorage(AxisStorage axisStorage) {
+ this.axisStorage =axisStorage;
+ }
+
+ public AxisStorage getAxisStorage() {
+ return axisStorage;
+ }
+
+ //to check whether a given paramter is locked
+ public boolean isParamterLocked(String paramterName) {
+ Parameter parameter = getParameter(paramterName);
+ return parameter != null && parameter.isLocked();
+ }
+
+ public ServiceGroupDescription getServiceGroup(String serviceNameAndGroupString) {
+ String serviceGroup [] = splitServiceName(serviceNameAndGroupString);
+ return (ServiceGroupDescription)serviceGroups.get(serviceGroup[0]);
+ }
+
+ public Iterator getServiceGroups() {
+ return serviceGroups.values().iterator();
+ }
+
+ public void setOutPhases(ArrayList outPhases) {
+ this.outPhases = outPhases;
+ }
+
+
+ public ArrayList getInPhasesUptoAndIncludingPostDispatch() {
+ return inPhasesUptoAndIncludingPostDispatch;
+ }
+
+ public ArrayList getOutFlow() {
+ return outPhases;
+ }
+
+
+ /**
+ <<<<<<< .mine
+ * @return ArrayList
+ =======
+ >>>>>>> .r280753
+ */
+ public ArrayList getInFaultFlow() {
+ return inFaultPhases;
+ }
+
+ /**
+ <<<<<<< .mine
+ * @return ArrayList
+ =======
+ >>>>>>> .r280753
+ */
+ public ArrayList getOutFaultFlow() {
+ return outFaultPhases;
+ }
+
+ /**
+ * @param list
+ */
+ public void setInFaultPhases(ArrayList list) {
+ inFaultPhases = list;
+ }
+
+ /**
+ * @param list
+ */
+ public void setOutFaultPhases(ArrayList list) {
+ outFaultPhases = list;
+ }
+
+ ////////////////////////// Form Axis Global
+
+ public void addMessageReceiver(String key,
+ MessageReceiver messageReceiver) {
+ messagReceivers.put(key, messageReceiver);
+ }
+
+ public MessageReceiver getMessageReceiver(String key) {
+ return (MessageReceiver) messagReceivers.get(key);
+ }
+
+ /**
+ * Method getParameter
+ *
+ * @param name
+ <<<<<<< .mine
+ * @return Parameter
+ =======
+ >>>>>>> .r280753
+ */
+ public Parameter getParameter(String name) {
+ return paramInclude.getParameter(name);
+ }
+
+ public ArrayList getParameters() {
+ return paramInclude.getParameters();
+ }
+
+ /**
+ * Method addParameter
+ *
+ * @param param
+ */
+ public void addParameter(Parameter param) throws AxisFault{
+ if(isParamterLocked(param.getName())){
+ throw new AxisFault("Parmter is locked can not overide: " + param.getName());
+ } else{
+ paramInclude.addParameter(param);
+ }
+ }
+
+ /**
+ * Method getEngadgedModules
+ *
+ <<<<<<< .mine
+ * @return Collection
+ =======
+ >>>>>>> .r280753
+ */
+ public Collection getEngadgedModules() {
+ return engagedModules;
+ }
+
+ public void engageModule(QName moduleref) throws AxisFault {
+ ModuleDescription module = getModule(moduleref);
+ boolean isNewmodule = false;
+ boolean tobeEnaged = true;
+ if (module == null) {
+ File file = new ArchiveReader().creatModuleArchivefromResource(
+ moduleref.getLocalPart(), getRepository());
+ module = new DeploymentEngine().buildModule(file);
+ isNewmodule = true;
+ }
+ if (module != null) {
+ for (Iterator iterator = engagedModules.iterator();
+ iterator.hasNext();) {
+ QName qName = (QName) iterator.next();
+ if (moduleref.equals(qName)) {
+ tobeEnaged = false;
+ //Instead of throwing the error, we can just log this problem
+ log.info("Attempt to engage an already engaged module "+ qName);
+// throw new AxisFault(moduleref.getLocalPart() +
+// " module has alredy engaged globally" +
+// " operation terminated !!!");
+ }
+ }
+ } else {
+ throw new AxisFault(
+ this + " Refer to invalid module "
+ + moduleref.getLocalPart() +
+ " has not bean deployed yet !");
+ }
+ if (tobeEnaged) {
+ new PhaseResolver(this).engageModuleGlobally(module);
+ engagedModules.add(moduleref);
+ }
+ if (isNewmodule) {
+ addModule(module);
+ }
+ }
+
+ //to get all the services in the system
+ public HashMap getServices() {
+ Iterator sgs = getServiceGroups();
+ while (sgs.hasNext()) {
+ ServiceGroupDescription groupDescription = (ServiceGroupDescription) sgs.next();
+ Iterator servics = groupDescription.getServices();
+ while (servics.hasNext()) {
+ ServiceDescription serviceDescription = (ServiceDescription) servics.next();
+ allservices.put(serviceDescription.getName().getLocalPart(),serviceDescription);
+ }
+ }
+ return allservices;
+ }
+
+ public boolean isEngaged(QName moduleName) {
+ return engagedModules.contains(moduleName);
+ }
+
+ public PhasesInfo getPhasesinfo() {
+ return phasesinfo;
+ }
+
+ public void setPhasesinfo(PhasesInfo phasesinfo) {
+ this.phasesinfo = phasesinfo;
+ }
+
+ public String getRepository() {
+ return axis2Repository;
+ }
+
+ public void setRepository(String axis2Repository) {
+ this.axis2Repository = axis2Repository;
+ }
+
+ public void notifyObservers(int event_type , ServiceDescription service){
+ AxisEvent event = new AxisEvent(service,event_type);
+ for (int i = 0; i < observersList.size(); i++) {
+ AxisObserver axisObserver = (AxisObserver) observersList.get(i);
+ axisObserver.update(event);
+ }
+ }
+
+ public void addObservers(AxisObserver axisObserver){
+ observersList.add(axisObserver);
+ }
+
+
+ /**
+ * Adding module configuration , if there is moduleConfig tag in service
+ * @param moduleConfiguration
+ */
+ public void addModuleConfig(ModuleConfiguration moduleConfiguration){
+ if(moduleConfigmap == null){
+ moduleConfigmap = new HashMap();
+ }
+ moduleConfigmap.put(moduleConfiguration.getModuleName(),moduleConfiguration);
+ }
+
+ public ModuleConfiguration getModuleConfig(QName moduleName){
+ return (ModuleConfiguration)moduleConfigmap.get(moduleName);
+ }
+
+
+ /**
+ * To split a given service name into it serviceGroupName and Service Name
+ * if the service Name is foo:bar then serviceGroupName ="foo" and ServiceName ="bar"
+ * but if the service name is only the foo we asume ServiceGroupName="foo" ans ServiceName="foo"
+ * meaning foo := foo:foo
+ * @param serviceName
+ * @return String [] <code>String</code>
+ */
+ public static String [] splitServiceName(String serviceName){
+ String namePart [] = new String[2];
+ int index = serviceName.indexOf(Constants.SERVICE_NAME_SPLIT_CHAR);
+ if(index > 0){
+ namePart[0] = serviceName.substring(0,index);
+ namePart[1] = serviceName.substring(index +1 ,serviceName.length());
+ } else {
+ namePart[0] = serviceName;
+ namePart[1] = serviceName;
+ }
+ return namePart;
+ }
+
+
+}
Propchange: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
------------------------------------------------------------------------------
svn:eol-style = native