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 de...@apache.org on 2005/12/02 04:51:23 UTC
svn commit: r351567 [1/2] - in /webservices/axis2/trunk/java/modules:
codegen/test/org/apache/axis2/rpc/ common/src/org/apache/axis2/i18n/
core/src/org/apache/axis2/client/ core/src/org/apache/axis2/context/
core/src/org/apache/axis2/deployment/ core/s...
Author: deepal
Date: Thu Dec 1 19:50:05 2005
New Revision: 351567
URL: http://svn.apache.org/viewcvs?rev=351567&view=rev
Log:
1. I make AxisConfiguration into a concrete class , and removed the interface. But there may be some code which cast axisConfiguration to same type since I did a refactoring I might not have found all the occurrences if you see any pls correct that for me.
2. In troduce AxisMessage , wchih is a child of AxisOperation , and I have added a test cases as well.
Added:
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java
webservices/axis2/trunk/java/modules/core/test-resources/deployment/AxisMessageTestRepo/
webservices/axis2/trunk/java/modules/core/test-resources/deployment/AxisMessageTestRepo/axis2.xml
webservices/axis2/trunk/java/modules/core/test-resources/deployment/AxisMessageTestRepo/services/
webservices/axis2/trunk/java/modules/core/test-resources/deployment/AxisMessageTestRepo/services/MessagetestService/
webservices/axis2/trunk/java/modules/core/test-resources/deployment/AxisMessageTestRepo/services/MessagetestService/META-INF/
webservices/axis2/trunk/java/modules/core/test-resources/deployment/AxisMessageTestRepo/services/MessagetestService/META-INF/services.xml
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/deployment/AxisMessageTest.java
Removed:
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
Modified:
webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/rpc/SimpleTest.java
webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/resource.properties
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Call.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/MessageSender.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOnlyAxisOperation.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOutAxisOperation.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/context/ContextHierarchyTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/context/OperationContextTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/deployment/BadModuleTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/deployment/BadServerXMLTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/description/RegistryTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/EnginePausingTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/EngineWithoutPhaseResolvingTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/MessageContextTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/ModuleConfigTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/ParamterAddTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/BeforeAfterTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/BeforeTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/BeforeWithNoFirstHandlerTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/InvalidPhaseFirstRulesTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/InvalidPhaseFirstTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/InvalidPhaseLastRuleTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/InvalidPhaseRuleTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/InvalidPhaselastTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PhaseFirstTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PhaseLastTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PhaseRuleTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/PreDispatchPhaseRuleTest.java
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/phaserule/SingleHandlerPhaseTest.java
webservices/axis2/trunk/java/modules/core/webapp/ViewGlobalHandlers.jsp
webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/round1/Round1Client.java
webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/round2/SunRound2Client.java
webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/round3/SunRound3Client.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/HandlerFailureTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/MessageContextInjectionTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/MessageWithServerTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/SpeakingHandler1.java
Modified: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/rpc/SimpleTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/rpc/SimpleTest.java?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/rpc/SimpleTest.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/rpc/SimpleTest.java Thu Dec 1 19:50:05 2005
@@ -31,7 +31,7 @@
import org.apache.axis2.description.ParameterImpl;
import org.apache.axis2.description.TransportInDescription;
import org.apache.axis2.description.TransportOutDescription;
-import org.apache.axis2.engine.AxisConfigurationImpl;
+import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.om.OMAbstractFactory;
import org.apache.axis2.receivers.AbstractMessageReceiver;
import org.apache.axis2.soap.SOAPBody;
@@ -140,7 +140,7 @@
// Set up Axis configuration
- AxisConfigurationImpl config = new AxisConfigurationImpl();
+ AxisConfiguration config = new AxisConfiguration();
TransportInDescription tIn = new TransportInDescription(new QName(Constants.TRANSPORT_LOCAL));
config.addTransportIn(tIn);
Modified: webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/resource.properties
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/resource.properties?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/resource.properties (original)
+++ webservices/axis2/trunk/java/modules/common/src/org/apache/axis2/i18n/resource.properties Thu Dec 1 19:50:05 2005
@@ -71,7 +71,7 @@
confignotfound=can not find org/apache/axis2/deployment/axis2.xml
pathtoconfigcanotnull=path to axis2.xml can not be NUll
modulevalfailed=Module validation failed {0}
-invalidphase=Invalid System predefined in phases , phase order dose not support\n recheck axis2.xml
+invalidphase=Invalid phases please recheck axis2.xml {0} for the handler {1}
invalidmoduleref=Service {0} refer to invalide module {1}
invalidmodulerefbyop=Operation {0} refer to invalide module {1}
addingnewmodule=adding new module
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Call.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Call.java?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Call.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Call.java Thu Dec 1 19:50:05 2005
@@ -26,7 +26,6 @@
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.OutInAxisOperation;
import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.engine.AxisConfigurationImpl;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.soap.SOAPEnvelope;
import org.apache.wsdl.WSDLConstants;
@@ -176,7 +175,7 @@
axisOperationTemplate = new OutInAxisOperation(new QName("TemplateOperation"));
AxisConfiguration axisConfiguration = serviceContext.getConfigurationContext().getAxisConfiguration();
- PhasesInfo info = ((AxisConfigurationImpl) axisConfiguration).getPhasesinfo();
+ PhasesInfo info = ((AxisConfiguration) axisConfiguration).getPhasesinfo();
//to set the operation flows
if (info != null) {
info.setOperationPhases(axisOperationTemplate);
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/MessageSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/MessageSender.java?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/MessageSender.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/MessageSender.java Thu Dec 1 19:50:05 2005
@@ -25,7 +25,6 @@
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.OutOnlyAxisOperation;
import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.engine.AxisConfigurationImpl;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.soap.SOAPEnvelope;
import org.apache.wsdl.WSDLConstants;
@@ -121,7 +120,7 @@
AxisService axisService = serviceContext.getAxisService();
AxisConfiguration axisConfiguration = serviceContext.getConfigurationContext().getAxisConfiguration();
- PhasesInfo info = ((AxisConfigurationImpl) axisConfiguration).getPhasesinfo();
+ PhasesInfo info = ((AxisConfiguration) axisConfiguration).getPhasesinfo();
//to set the operation flows
if (info != null) {
info.setOperationPhases(axisOperationTemplate);
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java Thu Dec 1 19:50:05 2005
@@ -7,7 +7,6 @@
import org.apache.axis2.description.TransportInDescription;
import org.apache.axis2.description.TransportOutDescription;
import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.engine.AxisConfigurationImpl;
import org.apache.axis2.modules.Module;
import org.apache.axis2.phaseresolver.PhaseResolver;
import org.apache.axis2.transport.TransportListener;
@@ -83,7 +82,7 @@
throws DeploymentException {
try {
HashMap modules =
- ((AxisConfigurationImpl) context.getAxisConfiguration())
+ ((AxisConfiguration) context.getAxisConfiguration())
.getModules();
Collection col = modules.values();
for (Iterator iterator = col.iterator(); iterator.hasNext();) {
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java Thu Dec 1 19:50:05 2005
@@ -22,7 +22,6 @@
import org.apache.axis2.addressing.RelatesTo;
import org.apache.axis2.description.*;
import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.engine.AxisConfigurationImpl;
import org.apache.axis2.soap.SOAP11Constants;
import org.apache.axis2.soap.SOAP12Constants;
import org.apache.axis2.soap.SOAPEnvelope;
@@ -705,7 +704,7 @@
}
}
AxisConfiguration baseConfig = configurationContext.getAxisConfiguration();
- moduleConfig = ((AxisConfigurationImpl) baseConfig).getModuleConfig(new QName(moduleName));
+ moduleConfig = ((AxisConfiguration) baseConfig).getModuleConfig(new QName(moduleName));
if (moduleConfig != null) {
param = moduleConfig.getParameter(key);
if (param != null) {
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisConfigBuilder.java Thu Dec 1 19:50:05 2005
@@ -20,7 +20,10 @@
import org.apache.axis2.deployment.util.PhasesInfo;
import org.apache.axis2.deployment.util.Utils;
import org.apache.axis2.description.*;
-import org.apache.axis2.engine.*;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.engine.AxisObserver;
+import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.engine.Phase;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.om.OMAttribute;
import org.apache.axis2.om.OMElement;
@@ -65,7 +68,7 @@
MessageReceiver msgrecivere = loadMessageReceiver(
Thread.currentThread().getContextClassLoader(), msgRev);
OMAttribute mepAtt = msgRev.getAttribute(new QName(MEP));
- ((AxisConfigurationImpl) axisConfiguration).addMessageReceiver(
+ axisConfiguration.addMessageReceiver(
mepAtt.getAttributeValue(), msgrecivere);
}
@@ -368,7 +371,7 @@
// initilization
observer.init();
- ((AxisConfigurationImpl) axisConfiguration).addObservers(observer);
+ axisConfiguration.addObservers(observer);
} catch (ClassNotFoundException e) {
throw new DeploymentException(e);
@@ -411,7 +414,7 @@
new ModuleConfiguration(new QName(module), parent);
Iterator paramters = moduleConfig.getChildrenWithName(new QName(PARAMETER));
processParameters(paramters, moduleConfiguration, parent);
- ((AxisConfigurationImpl) config).addModuleConfig(moduleConfiguration);
+ config.addModuleConfig(moduleConfiguration);
}
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java Thu Dec 1 19:50:05 2005
@@ -32,6 +32,8 @@
String LISTENERST = "listener";// paramater start tag
String HANDERST = "handler";
String MODULEST = "module";
+ String MESSGES = "message";
+ String LABEL = "label";
String MODULECONFIG = "moduleConfig";
String HOST_CONFIG = "hostConfiguration";
String PHASEST = "phase";
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java Thu Dec 1 19:50:05 2005
@@ -29,7 +29,6 @@
import org.apache.axis2.deployment.util.Utils;
import org.apache.axis2.description.*;
import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.engine.AxisConfigurationImpl;
import org.apache.axis2.engine.Phase;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.phaseresolver.PhaseMetadata;
@@ -202,13 +201,13 @@
throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.PATH_TO_CONFIG_CAN_NOT_B_NULL));
}
File tempfile = new File(engineConfigName);
- RepositoryListenerImpl repoListener = null;
+ RepositoryListenerImpl repoListener;
try {
InputStream in = new FileInputStream(tempfile);
axisConfig = createEngineConfig();
AxisConfigBuilder builder = new AxisConfigBuilder(in, this, axisConfig);
builder.populateConfig();
- ((AxisConfigurationImpl) axisConfig).setPhasesinfo(phasesinfo);
+ axisConfig.setPhasesinfo(phasesinfo);
//setting the CLs
setClassLoaders(repository);
} catch (FileNotFoundException e) {
@@ -217,7 +216,7 @@
setDeploymentFeatures();
repoListener = new RepositoryListenerImpl(folderName, this);
try {
- ((AxisConfigurationImpl) axisConfig).setRepository(axis2repository);
+ axisConfig.setRepository(axis2repository);
validateSystemPredefinedPhases();
engageModules();
} catch (AxisFault axisFault) {
@@ -255,7 +254,7 @@
}
axisConfig = createEngineConfig();
AxisConfigBuilder builder = new AxisConfigBuilder(in, this, axisConfig);
- ((AxisConfigurationImpl) axisConfig).setPhasesinfo(phasesinfo);
+ axisConfig.setPhasesinfo(phasesinfo);
builder.populateConfig();
if (isRepositoryExist) {
hotDeployment = false;
@@ -265,7 +264,7 @@
repoListener = new RepositoryListenerImpl(folderName, this);
}
try {
- ((AxisConfigurationImpl) axisConfig).setRepository(axis2repository);
+ axisConfig.setRepository(axis2repository);
validateSystemPredefinedPhases();
engageModules();
} catch (AxisFault axisFault) {
@@ -353,9 +352,9 @@
} catch (Exception e) {
throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.INVALID_PHASE));
}
- ((AxisConfigurationImpl) axisConfig).setInPhasesUptoAndIncludingPostDispatch(
+ axisConfig.setInPhasesUptoAndIncludingPostDispatch(
phasesinfo.getGlobalInflow());
- ((AxisConfigurationImpl) axisConfig).setInFaultPhases(phasesinfo.getIN_FaultPhases());
+ axisConfig.setInFaultPhases(phasesinfo.getIN_FaultPhases());
axisConfig.setGlobalOutPhase(phasesinfo.getGlobalOutPhaseList());
}
@@ -374,7 +373,7 @@
}
private AxisConfiguration createEngineConfig() {
- return new AxisConfigurationImpl();
+ return new AxisConfiguration();
}
private void addServiceGroup(AxisServiceGroup serviceGroup, ArrayList serviceList)
@@ -382,7 +381,7 @@
serviceGroup.setParent(axisConfig);
//engaging globally engage module to this service group
Iterator itr_global_modules =
- ((AxisConfigurationImpl) axisConfig).getEngagedModules().iterator();
+ axisConfig.getEngagedModules().iterator();
while (itr_global_modules.hasNext()) {
QName qName = (QName) itr_global_modules.next();
serviceGroup.engageModuleToGroup(qName);
@@ -715,7 +714,7 @@
public ModuleDescription buildModule(File modulearchive, AxisConfiguration config) throws DeploymentException {
ModuleDescription axismodule;
try {
- this.setPhasesinfo(((AxisConfigurationImpl) config).getPhasesinfo());
+ this.setPhasesinfo(config.getPhasesinfo());
currentArchiveFile = new ArchiveFileData(modulearchive, MODULE);
axismodule = new ModuleDescription();
axismodule.setModuleClassLoader(currentArchiveFile.getClassLoader());
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ModuleBuilder.java Thu Dec 1 19:50:05 2005
@@ -23,7 +23,6 @@
import org.apache.axis2.description.InOnlyAxisOperation;
import org.apache.axis2.description.ModuleDescription;
import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.engine.AxisConfigurationImpl;
import org.apache.axis2.engine.MessageReceiver;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.modules.Module;
@@ -202,7 +201,7 @@
processOperationModuleRefs(modules, op_descrip);
//setting Operation phase
- PhasesInfo info = ((AxisConfigurationImpl) axisConfig).getPhasesinfo();
+ PhasesInfo info = axisConfig.getPhasesinfo();
info.setOperationPhases(op_descrip);
//adding the opeartion
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java Thu Dec 1 19:50:05 2005
@@ -18,15 +18,8 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.deployment.util.PhasesInfo;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisOperationFactory;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.InOutAxisOperation;
-import org.apache.axis2.description.ModuleConfiguration;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.description.ParameterInclude;
+import org.apache.axis2.description.*;
import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.engine.AxisConfigurationImpl;
import org.apache.axis2.engine.MessageReceiver;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.om.OMAttribute;
@@ -227,9 +220,13 @@
new QName(MODULEST));
processOperationModuleRefs(modules, op_descrip);
+ //processing Messages
+ Iterator messages = operation.getChildrenWithName(new QName(MESSGES));
+ processMessages(messages, op_descrip);
+
//setting Operation phase
if (axisConfig != null) {
- PhasesInfo info = ((AxisConfigurationImpl) axisConfig).getPhasesinfo();
+ PhasesInfo info = axisConfig.getPhasesinfo();
info.setOperationPhases(op_descrip);
}
@@ -242,6 +239,21 @@
return operations;
}
+ private void processMessages(Iterator messages, AxisOperation operation)
+ throws DeploymentException {
+ while (messages.hasNext()) {
+ OMElement messageElement = (OMElement) messages.next();
+ OMAttribute lable = messageElement.getAttribute(new QName(LABEL));
+ if (lable == null) {
+ throw new DeploymentException("message lebel can not be null");
+ }
+ AxisMessage message = new AxisMessage();
+ Iterator paramters = messageElement.getChildrenWithName(new QName(PARAMETER));
+ processParameters(paramters, message, operation);
+ operation.addMessage(message, lable.getAttributeValue().trim());
+ }
+
+ }
protected void processServiceModuleConfig(Iterator moduleConfigs,
ParameterInclude parent, AxisService service)
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/axis2.xml Thu Dec 1 19:50:05 2005
@@ -125,6 +125,10 @@
class="org.apache.axis2.engine.InstanceDispatcher">
<order phase="PostDispatch"/>
</handler>
+ <handler name="SOAPProcessingModelChecker"
+ class="org.apache.axis2.engine.SOAPProcessingModelChecker">
+ <order phase="PostDispatch"/>
+ </handler>
</phase>
<!-- System pre defined phases -->
<!-- After Postdispatch phase module author or or service author can add any phase he want -->
Added: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java?rev=351567&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java (added)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisMessage.java Thu Dec 1 19:50:05 2005
@@ -0,0 +1,94 @@
+package org.apache.axis2.description;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.om.OMElement;
+
+import java.util.ArrayList;
+/*
+* 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.
+*
+* @author : Deepal Jayasinghe (deepal@apache.org)
+*
+*/
+
+/**
+ * This class represent the messages in WSDL , and there can be message element in services.xml
+ * those will be representd by this class
+ */
+
+public class AxisMessage implements ParameterInclude {
+
+ private ParameterInclude paramterinclude;
+ private ArrayList operationFlow;
+ private AxisOperation parent;
+
+ public AxisMessage() {
+ paramterinclude = new ParameterIncludeImpl();
+ operationFlow = new ArrayList();
+ }
+
+ public void addParameter(Parameter param) throws AxisFault {
+ if (param == null) {
+ return;
+ }
+ if (isParameterLocked(param.getName())) {
+ throw new AxisFault("Parmter is locked can not overide: " + param.getName());
+ } else {
+ paramterinclude.addParameter(param);
+ }
+ }
+
+ public Parameter getParameter(String name) {
+ return paramterinclude.getParameter(name);
+ }
+
+ public ArrayList getParameters() {
+ return paramterinclude.getParameters();
+ }
+
+ public boolean isParameterLocked(String paramterName) {
+ // checking the locked value of parent
+ boolean loscked = false;
+ if (getParent() != null) {
+ loscked = getParent().isParameterLocked(paramterName);
+ }
+ if (loscked) {
+ return true;
+ } else {
+ Parameter parameter = getParameter(paramterName);
+ return parameter != null && parameter.isLocked();
+ }
+ }
+
+ public void deserializeParameters(OMElement parameterElement) throws AxisFault {
+ paramterinclude.deserializeParameters(parameterElement);
+ }
+
+ public ArrayList getMessageFlow() {
+ return operationFlow;
+ }
+
+ public void setMessageFlow(ArrayList operationFlow) {
+ this.operationFlow = operationFlow;
+ }
+
+ public AxisOperation getParent() {
+ return parent;
+ }
+
+ public void setParent(AxisOperation parent) {
+ this.parent = parent;
+ }
+}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java Thu Dec 1 19:50:05 2005
@@ -1,35 +1,24 @@
package org.apache.axis2.description;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.om.OMElement;
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.engine.*;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.engine.AxisError;
+import org.apache.axis2.engine.MessageReceiver;
import org.apache.axis2.i18n.Messages;
-import org.apache.axis2.phaseresolver.PhaseMetadata;
+import org.apache.axis2.om.OMElement;
import org.apache.axis2.phaseresolver.PhaseResolver;
-import org.apache.wsdl.MessageReference;
-import org.apache.wsdl.WSDLConstants;
-import org.apache.wsdl.WSDLExtensibilityAttribute;
-import org.apache.wsdl.WSDLExtensibilityElement;
-import org.apache.wsdl.WSDLFaultReference;
-import org.apache.wsdl.WSDLFeature;
-import org.apache.wsdl.WSDLOperation;
-import org.apache.wsdl.WSDLProperty;
-import org.apache.wsdl.impl.WSDLOperationImpl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.wsdl.*;
+import org.apache.wsdl.impl.WSDLOperationImpl;
import org.w3c.dom.Document;
import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -48,16 +37,16 @@
*
*/
-public abstract class AxisOperation implements
+public abstract class AxisOperation implements
ParameterInclude, DescriptionConstants,
- WSDLConstants ,WSDLOperation{
+ WSDLConstants, WSDLOperation {
private Log log = LogFactory.getLog(getClass());
private MessageReceiver messageReceiver;
- private ArrayList remainingPhasesInFlow;
- private ArrayList phasesOutFlow;
- private ArrayList phasesInFaultFlow;
- private ArrayList phasesOutFaultFlow;
+// private ArrayList remainingPhasesInFlow;
+// private ArrayList phasesOutFlow;
+// private ArrayList phasesInFaultFlow;
+// private ArrayList phasesOutFaultFlow;
private HashMap moduleConfigmap;
@@ -76,25 +65,10 @@
private ArrayList engagedModules = new ArrayList();
-
public AxisOperation(WSDLOperation wsdlopeartion) {
- this.wsdlopeartion = (WSDLOperationImpl)wsdlopeartion;
+ this.wsdlopeartion = (WSDLOperationImpl) wsdlopeartion;
this.setMessageExchangePattern(MEP_URI_IN_OUT);
this.setComponentProperty(PARAMETER_KEY, new ParameterIncludeImpl());
-
- remainingPhasesInFlow = new ArrayList();
- remainingPhasesInFlow.add(
- new Phase(PhaseMetadata.PHASE_POLICY_DETERMINATION));
- Phase messageProcessing = new Phase(PhaseMetadata.PHASE_MESSAGE_PROCESSING);
- messageProcessing.addHandler(new SOAPProcessingModelChecker());
- remainingPhasesInFlow.add(messageProcessing);
-
- phasesOutFlow = new ArrayList();
- phasesOutFlow.add(new Phase(PhaseMetadata.PHASE_POLICY_DETERMINATION));
- phasesOutFlow.add(new Phase(PhaseMetadata.PHASE_MESSAGE_OUT));
-
- phasesInFaultFlow = new ArrayList();
- phasesOutFaultFlow = new ArrayList();
modulerefs = new ArrayList();
moduleConfigmap = new HashMap();
}
@@ -120,7 +94,7 @@
if (moduleref == null) {
return;
}
- Iterator module_itr = engagedModules.iterator();
+ Iterator module_itr = engagedModules.iterator();
while (module_itr.hasNext()) {
ModuleDescription module = (ModuleDescription) module_itr.next();
if (module.getName().equals(moduleref.getName())) {
@@ -142,7 +116,6 @@
/**
* Method getEngadgedModules
- *
*/
public Collection getEngagedModules() {
return engagedModules;
@@ -157,9 +130,9 @@
if (param == null) {
return;
}
- if(isParameterLocked(param.getName())){
+ if (isParameterLocked(param.getName())) {
throw new AxisFault("Parmter is locked can not overide: " + param.getName());
- } else{
+ } else {
ParameterIncludeImpl paramInclude = (ParameterIncludeImpl) this
.getComponentProperty(PARAMETER_KEY);
paramInclude.addParameter(param);
@@ -180,8 +153,9 @@
public ArrayList getParameters() {
ParameterIncludeImpl paramInclude = (ParameterIncludeImpl) this
.getComponentProperty(PARAMETER_KEY);
- return paramInclude.getParameters();
+ return paramInclude.getParameters();
}
+
public MessageReceiver getMessageReceiver() {
return messageReceiver;
}
@@ -200,7 +174,6 @@
* This method will simply map the String URI of the Message exchange
* pattern to a integer. Further in the first lookup it will cash the looked
* up value so that the subsequent method calls will be extremely efficient.
- *
*/
public int getAxisSpecifMEPConstant() {
if (this.mep != MEP_CONSTANT_INVALID) {
@@ -237,52 +210,18 @@
}
- public ArrayList getPhasesInFaultFlow() {
- return phasesInFaultFlow;
- }
-
-
- public ArrayList getPhasesOutFaultFlow() {
- return phasesOutFaultFlow;
- }
-
-
- public ArrayList getPhasesOutFlow() {
- return phasesOutFlow;
- }
-
-
- public ArrayList getRemainingPhasesInFlow() {
- return remainingPhasesInFlow;
- }
-
- /**
- * @param list
- */
- public void setPhasesInFaultFlow(ArrayList list) {
- phasesInFaultFlow = list;
- }
-
- /**
- * @param list
- */
- public void setPhasesOutFaultFlow(ArrayList list) {
- phasesOutFaultFlow = list;
- }
-
- /**
- * @param list
- */
- public void setPhasesOutFlow(ArrayList list) {
- phasesOutFlow = list;
- }
+ public abstract ArrayList getPhasesInFaultFlow();
+ public abstract ArrayList getPhasesOutFaultFlow() ;
+ public abstract ArrayList getPhasesOutFlow() ;
+ public abstract ArrayList getRemainingPhasesInFlow() ;
+ public abstract AxisMessage getMessage(String label);
+
+ public abstract void setPhasesInFaultFlow(ArrayList list) ;
+ public abstract void setPhasesOutFaultFlow(ArrayList list) ;
+ public abstract void setPhasesOutFlow(ArrayList list) ;
+ public abstract void setRemainingPhasesInFlow(ArrayList list) ;
+ public abstract void addMessage(AxisMessage message,String label);
- /**
- * @param list
- */
- public void setRemainingPhasesInFlow(ArrayList list) {
- remainingPhasesInFlow = list;
- }
public void addModule(QName moduleName) {
modulerefs.add(moduleName);
@@ -303,11 +242,11 @@
//to check whether a given paramter is locked
public boolean isParameterLocked(String paramterName) {
// checking the locked value of parent
- boolean loscked = false;
- if (getParent() !=null) {
- loscked= getParent().isParameterLocked(paramterName);
+ boolean loscked = false;
+ if (getParent() != null) {
+ loscked = getParent().isParameterLocked(paramterName);
}
- if(loscked){
+ if (loscked) {
return true;
} else {
Parameter parameter = getParameter(paramterName);
@@ -317,14 +256,15 @@
/**
* Adding module configuration , if there is moduleConfig tag in operation
+ *
* @param moduleConfiguration
*/
- public void addModuleConfig(ModuleConfiguration moduleConfiguration){
- moduleConfigmap.put(moduleConfiguration.getModuleName(),moduleConfiguration);
+ public void addModuleConfig(ModuleConfiguration moduleConfiguration) {
+ moduleConfigmap.put(moduleConfiguration.getModuleName(), moduleConfiguration);
}
- public ModuleConfiguration getModuleConfig(QName moduleName){
- return (ModuleConfiguration)moduleConfigmap.get(moduleName);
+ public ModuleConfiguration getModuleConfig(QName moduleName) {
+ return (ModuleConfiguration) moduleConfigmap.get(moduleName);
}
@@ -335,12 +275,13 @@
* in operationContext.
* As an exmple if the MEP is IN-OUT then depending on messagelbl operation description
* should know how to keep them in corret locations
+ *
* @param msgContext <code>MessageContext</code>
* @param opContext <code>OperationContext</code>
* @throws AxisFault <code>AxisFault</code>
*/
public abstract void addMessageContext(MessageContext msgContext, OperationContext opContext)
- throws AxisFault ;
+ throws AxisFault;
public List getInfaults() {
return wsdlopeartion.getInfaults();
@@ -478,7 +419,7 @@
return wsdlopeartion.getMetadataBag();
}
- public void setMetadataBag(Map meMap){
+ public void setMetadataBag(Map meMap) {
wsdlopeartion.setMetadataBag(meMap);
}
@@ -504,23 +445,24 @@
*
* @param msgContext
*/
- public OperationContext findOperationContext(MessageContext msgContext, ServiceContext serviceContext) throws AxisFault {
- OperationContext operationContext ;
+ public OperationContext findOperationContext(MessageContext msgContext,
+ ServiceContext serviceContext) throws AxisFault {
+ OperationContext operationContext;
if (null == msgContext.getRelatesTo()) {
//Its a new incomming message so get the factory to create a new
// one
- operationContext = new OperationContext(this,serviceContext);
+ operationContext = new OperationContext(this, serviceContext);
} else {
// So this message is part of an ongoing MEP
// operationContext =
ConfigurationContext configContext = msgContext.getConfigurationContext();
operationContext =
- configContext.getOperationContext( msgContext.getRelatesTo().getValue());
+ configContext.getOperationContext(msgContext.getRelatesTo().getValue());
if (null == operationContext) {
throw new AxisFault(Messages.getMessage("cannotCorrelateMsg",
- this.getName().toString(),msgContext.getRelatesTo().getValue()));
+ this.getName().toString(), msgContext.getRelatesTo().getValue()));
}
}
@@ -533,13 +475,15 @@
/**
* This will not create a new operation context if there is no one already.
+ *
* @param msgContext
* @return
* @throws AxisFault
*/
- public OperationContext findForExistingOperationContext(MessageContext msgContext) throws AxisFault {
- OperationContext operationContext ;
- if((operationContext = msgContext.getOperationContext()) != null) {
+ public OperationContext findForExistingOperationContext(
+ MessageContext msgContext) throws AxisFault {
+ OperationContext operationContext;
+ if ((operationContext = msgContext.getOperationContext()) != null) {
return operationContext;
}
@@ -549,11 +493,12 @@
// So this message is part of an ongoing MEP
// operationContext =
ConfigurationContext configContext = msgContext.getConfigurationContext();
- operationContext = configContext.getOperationContext(msgContext.getRelatesTo().getValue());
+ operationContext =
+ configContext.getOperationContext(msgContext.getRelatesTo().getValue());
if (null == operationContext) {
throw new AxisFault(Messages.getMessage("cannotCorrealteMsg",
- this.getName().toString(),msgContext.getRelatesTo().getValue()));
+ this.getName().toString(), msgContext.getRelatesTo().getValue()));
}
}
@@ -563,7 +508,8 @@
}
- public void registerOperationContext(MessageContext msgContext, OperationContext operationContext) throws AxisFault {
+ public void registerOperationContext(MessageContext msgContext,
+ OperationContext operationContext) throws AxisFault {
msgContext.getConfigurationContext().registerOperationContext(
msgContext.getMessageID(), operationContext);
operationContext.addMessageContext(msgContext);
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOnlyAxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOnlyAxisOperation.java?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOnlyAxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOnlyAxisOperation.java Thu Dec 1 19:50:05 2005
@@ -3,9 +3,11 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.context.OperationContext;
+import org.apache.wsdl.WSDLConstants;
import org.apache.wsdl.WSDLOperation;
import javax.xml.namespace.QName;
+import java.util.ArrayList;
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -31,25 +33,90 @@
*/
public class InOnlyAxisOperation extends AxisOperation {
+ private AxisMessage inMessage;
+ private AxisMessage inFaultMessage;
+ private AxisMessage outFaultMessage;
+
+ //this is just to stor the chain , there wont be any usage of this
+ private ArrayList outPhase;
+
public InOnlyAxisOperation(WSDLOperation wsdlopeartion) {
super(wsdlopeartion);
+ createMessage();
+ }
+
+ private void createMessage() {
+ inMessage = new AxisMessage();
+ inFaultMessage = new AxisMessage();
+ outFaultMessage = new AxisMessage();
+ outPhase = new ArrayList();
}
public InOnlyAxisOperation() {
super();
+ createMessage();
}
public InOnlyAxisOperation(QName name) {
super(name);
+ createMessage();
+ }
+
+ public ArrayList getPhasesInFaultFlow() {
+ return inFaultMessage.getMessageFlow();
+ }
+
+ public ArrayList getPhasesOutFaultFlow() {
+ return outFaultMessage.getMessageFlow();
+ }
+
+ public ArrayList getPhasesOutFlow() {
+ return outPhase;
+ }
+
+ public ArrayList getRemainingPhasesInFlow() {
+ return inMessage.getMessageFlow();
+ }
+
+ public AxisMessage getMessage(String label) {
+ if (WSDLConstants.MESSAGE_LABEL_IN_VALUE.equals(label)) {
+ return inMessage;
+ } else {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+ }
+
+ public void setPhasesInFaultFlow(ArrayList list) {
+ inFaultMessage.setMessageFlow(list);
+ }
+
+ public void setPhasesOutFaultFlow(ArrayList list) {
+ outFaultMessage.setMessageFlow(list);
+ }
+
+ public void setPhasesOutFlow(ArrayList list) {
+ outPhase = list;
+ }
+
+ public void setRemainingPhasesInFlow(ArrayList list) {
+ inMessage.setMessageFlow(list);
+ }
+
+ public void addMessage(AxisMessage message, String label) {
+ if (WSDLConstants.MESSAGE_LABEL_IN_VALUE.equals(label)) {
+ inMessage = message;
+ } else {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
}
public void addMessageContext(MessageContext msgContext, OperationContext opContext)
throws AxisFault {
- if(!opContext.isComplete()){
- opContext.getMessageContexts().put(MESSAGE_LABEL_IN_VALUE,msgContext);
+ if (!opContext.isComplete()) {
+ opContext.getMessageContexts().put(MESSAGE_LABEL_IN_VALUE, msgContext);
opContext.setComplete(true);
} else {
- throw new AxisFault("Invalid messge addition , operation context completed") ;
+ throw new AxisFault("Invalid messge addition , operation context completed");
}
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOutAxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOutAxisOperation.java?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOutAxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/InOutAxisOperation.java Thu Dec 1 19:50:05 2005
@@ -3,9 +3,11 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.context.OperationContext;
+import org.apache.wsdl.WSDLConstants;
import org.apache.wsdl.WSDLOperation;
import javax.xml.namespace.QName;
+import java.util.ArrayList;
import java.util.HashMap;
/*
* Copyright 2004,2005 The Apache Software Foundation.
@@ -32,29 +34,96 @@
*/
public class InOutAxisOperation extends AxisOperation {
+ private AxisMessage inMessage;
+ private AxisMessage inFaultMessage;
+ private AxisMessage outFaultMessage;
+ private AxisMessage outMessage;
+
public InOutAxisOperation(WSDLOperation wsdlopeartion) {
super(wsdlopeartion);
+ createMessages();
+ }
+
+ private void createMessages() {
+ inMessage = new AxisMessage();
+ inFaultMessage = new AxisMessage();
+ outFaultMessage = new AxisMessage();
+ outMessage = new AxisMessage();
}
public InOutAxisOperation() {
super();
+ createMessages();
}
public InOutAxisOperation(QName name) {
- super(name);
+ super(name);
+ createMessages();
+ }
+
+ public ArrayList getPhasesInFaultFlow() {
+ return inFaultMessage.getMessageFlow();
+ }
+
+ public ArrayList getPhasesOutFaultFlow() {
+ return outFaultMessage.getMessageFlow();
+ }
+
+ public ArrayList getPhasesOutFlow() {
+ return outMessage.getMessageFlow();
+ }
+
+ public ArrayList getRemainingPhasesInFlow() {
+ return inMessage.getMessageFlow();
+ }
+
+ public AxisMessage getMessage(String label) {
+ if (WSDLConstants.MESSAGE_LABEL_OUT_VALUE.equals(label)) {
+ return outMessage;
+ } else if (WSDLConstants.MESSAGE_LABEL_IN_VALUE.equals(label)) {
+ return inMessage;
+ } else {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+ }
+
+ public void setPhasesInFaultFlow(ArrayList list) {
+ inFaultMessage.setMessageFlow(list);
+ }
+
+ public void setPhasesOutFaultFlow(ArrayList list) {
+ outFaultMessage.setMessageFlow(list);
+ }
+
+ public void setPhasesOutFlow(ArrayList list) {
+ outMessage.setMessageFlow(list);
+ }
+
+ public void setRemainingPhasesInFlow(ArrayList list) {
+ inMessage.setMessageFlow(list);
+ }
+
+ public void addMessage(AxisMessage message, String label) {
+ if (WSDLConstants.MESSAGE_LABEL_OUT_VALUE.equals(label)) {
+ outMessage = message;
+ } else if (WSDLConstants.MESSAGE_LABEL_IN_VALUE.equals(label)) {
+ inMessage = message;
+ } else {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
}
public void addMessageContext(MessageContext msgContext, OperationContext opContext) throws AxisFault {
HashMap mep = opContext.getMessageContexts();
- MessageContext immsgContext = (MessageContext)mep.get(MESSAGE_LABEL_IN_VALUE);
- MessageContext outmsgContext = (MessageContext)mep.get(MESSAGE_LABEL_OUT_VALUE);
- if (immsgContext !=null && outmsgContext !=null){
- throw new AxisFault("Invalid messge addition , operation context completed") ;
+ MessageContext immsgContext = (MessageContext) mep.get(MESSAGE_LABEL_IN_VALUE);
+ MessageContext outmsgContext = (MessageContext) mep.get(MESSAGE_LABEL_OUT_VALUE);
+ if (immsgContext != null && outmsgContext != null) {
+ throw new AxisFault("Invalid messge addition , operation context completed");
}
- if(immsgContext == null){
- mep.put(MESSAGE_LABEL_IN_VALUE,msgContext);
- } else{
- mep.put(MESSAGE_LABEL_OUT_VALUE,msgContext);
+ if (immsgContext == null) {
+ mep.put(MESSAGE_LABEL_IN_VALUE, msgContext);
+ } else {
+ mep.put(MESSAGE_LABEL_OUT_VALUE, msgContext);
opContext.setComplete(true);
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java Thu Dec 1 19:50:05 2005
@@ -30,7 +30,7 @@
* Date: Oct 3, 2005
* Time: 6:01:33 PM
*/
-public class OutInAxisOperation extends AxisOperation {
+public class OutInAxisOperation extends InOutAxisOperation {
public OutInAxisOperation(WSDLOperation wsdlopeartion) {
super(wsdlopeartion);
@@ -41,20 +41,20 @@
}
public OutInAxisOperation(QName name) {
- super(name);
+ super(name);
}
public void addMessageContext(MessageContext msgContext, OperationContext opContext) throws AxisFault {
HashMap mep = opContext.getMessageContexts();
- MessageContext immsgContext = (MessageContext)mep.get(MESSAGE_LABEL_IN_VALUE);
- MessageContext outmsgContext = (MessageContext)mep.get(MESSAGE_LABEL_OUT_VALUE);
- if (immsgContext !=null && outmsgContext !=null){
- throw new AxisFault("Invalid messge addition , operation context completed") ;
+ MessageContext immsgContext = (MessageContext) mep.get(MESSAGE_LABEL_IN_VALUE);
+ MessageContext outmsgContext = (MessageContext) mep.get(MESSAGE_LABEL_OUT_VALUE);
+ if (immsgContext != null && outmsgContext != null) {
+ throw new AxisFault("Invalid messge addition , operation context completed");
}
- if(outmsgContext == null){
- mep.put(MESSAGE_LABEL_OUT_VALUE,msgContext);
- } else{
- mep.put(MESSAGE_LABEL_IN_VALUE,msgContext);
+ if (outmsgContext == null) {
+ mep.put(MESSAGE_LABEL_OUT_VALUE, msgContext);
+ } else {
+ mep.put(MESSAGE_LABEL_IN_VALUE, msgContext);
opContext.setComplete(true);
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java Thu Dec 1 19:50:05 2005
@@ -3,9 +3,11 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.context.OperationContext;
+import org.apache.wsdl.WSDLConstants;
import org.apache.wsdl.WSDLOperation;
import javax.xml.namespace.QName;
+import java.util.ArrayList;
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -21,35 +23,94 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
-*
*/
-/**
- * Author: Deepal Jayasinghe
- * Date: Oct 3, 2005
- * Time: 6:04:11 PM
- */
public class OutOnlyAxisOperation extends AxisOperation {
+ private AxisMessage outMessage;
+ private AxisMessage inFaultMessage;
+ private AxisMessage outFaultMessage;
+
+ //just to keep the inflow , there wont be any usage
+ private ArrayList inPhases;
+
public OutOnlyAxisOperation(WSDLOperation wsdlopeartion) {
super(wsdlopeartion);
+ createMessage();
+ }
+
+ private void createMessage() {
+ outMessage = new AxisMessage();
+ inFaultMessage = new AxisMessage();
+ outFaultMessage = new AxisMessage();
+ inPhases = new ArrayList();
}
public OutOnlyAxisOperation() {
super();
+ createMessage();
}
public OutOnlyAxisOperation(QName name) {
- super(name);
+ super(name);
+ createMessage();
+ }
+
+ public ArrayList getPhasesInFaultFlow() {
+ return inFaultMessage.getMessageFlow();
+ }
+
+ public ArrayList getPhasesOutFaultFlow() {
+ return outFaultMessage.getMessageFlow();
+ }
+
+ public ArrayList getPhasesOutFlow() {
+ return outMessage.getMessageFlow();
+ }
+
+ public ArrayList getRemainingPhasesInFlow() {
+ return inPhases;
+ }
+
+ public AxisMessage getMessage(String label) {
+ if (WSDLConstants.MESSAGE_LABEL_OUT_VALUE.equals(label)) {
+ return outMessage;
+ } else {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+ }
+
+ public void setPhasesInFaultFlow(ArrayList list) {
+ inFaultMessage.setMessageFlow(list);
+ }
+
+ public void setPhasesOutFaultFlow(ArrayList list) {
+ outFaultMessage.setMessageFlow(list);
+ }
+
+ public void setPhasesOutFlow(ArrayList list) {
+ outMessage.setMessageFlow(list);
+ }
+
+ public void setRemainingPhasesInFlow(ArrayList list) {
+ inPhases = list;
+ }
+
+ public void addMessage(AxisMessage message, String label) {
+ if (WSDLConstants.MESSAGE_LABEL_OUT_VALUE.equals(label)) {
+ outMessage = message;
+ } else {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
}
public void addMessageContext(MessageContext msgContext, OperationContext opContext)
throws AxisFault {
- if(!opContext.isComplete()){
- opContext.getMessageContexts().put(MESSAGE_LABEL_OUT_VALUE,msgContext);
+ if (!opContext.isComplete()) {
+ opContext.getMessageContexts().put(MESSAGE_LABEL_OUT_VALUE, msgContext);
opContext.setComplete(true);
} else {
- throw new AxisFault("Invalid messge addition , operation context completed") ;
+ throw new AxisFault("Invalid messge addition , operation context completed");
}
}
}
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=351567&r1=351566&r2=351567&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 Dec 1 19:50:05 2005
@@ -17,51 +17,177 @@
package org.apache.axis2.engine;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.AxisServiceGroup;
-import org.apache.axis2.description.ModuleDescription;
-import org.apache.axis2.description.ParameterInclude;
-import org.apache.axis2.description.TransportInDescription;
-import org.apache.axis2.description.TransportOutDescription;
+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.om.OMElement;
+import org.apache.axis2.phaseresolver.PhaseMetadata;
import org.apache.axis2.util.HostConfiguration;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
+import java.io.File;
+import java.util.*;
/**
- * The place 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.
+ * Class AxisConfigurationImpl
*/
-public interface AxisConfiguration extends ParameterInclude {
+public class AxisConfiguration implements ParameterInclude{
/**
- * Field INFLOW
+ * To store faulty services
*/
- public static final int INFLOW = 10003;
+ private Hashtable faultyServices;
+
+ private HashMap moduleConfigmap;
+
+ private Hashtable faultyModules;
+ private Log log = LogFactory.getLog(getClass());
+ //to store hots configuration if any
+ HostConfiguration hostConfiguration;
+
/**
- * Field OUTFLOW
+ * Field modules
*/
- public static final int OUTFLOW = 10004;
+ private final HashMap modules = new HashMap();
+
+ private final HashMap serviceGroups = new HashMap();
+ private final HashMap transportsIn = new HashMap();
+
+ private final HashMap transportsOut = new HashMap();
/**
- * Field FAULT_IN_FLOW
+ * Field phases
*/
- public static final int FAULT_IN_FLOW = 10005;
+ // private ArrayList inPhases;
+ private ArrayList outPhases;
+ private ArrayList inFaultPhases;
+ private ArrayList outFaultPhases;
- public static final int FAULT_OUT_FLOW = 10006;
+ private ArrayList inPhasesUptoAndIncludingPostDispatch;
+ /////////////////////// From AxisGlobal /////////////////////////////////////
/**
- * Method getService.
+ * Field paramInclude
+ */
+ protected final ParameterInclude paramInclude;
+
+
+ protected PhasesInfo phasesinfo;
+
+ /**
+ * Field engagedModules
+ */
+ protected final List engagedModules;
+
+ private String axis2Repository = null;
+
+ //to store AxisObserver Objects
+ private ArrayList observersList = null;
+
+ private HashMap allservices = new HashMap();
+
+
+ private ClassLoader systemClassLoader;
+ private ClassLoader serviceClassLoader;
+ private ClassLoader moduleClassLoader;
+
+
+ protected HashMap messagReceivers;
+ /////////////////////// From AxisGlobal /////////////////////////////////////
+
+ /**
+ * Constructor AxisConfigurationImpl
+ */
+ public AxisConfiguration() {
+ moduleConfigmap = new HashMap();
+ 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));
+ systemClassLoader = Thread.currentThread().getContextClassLoader();
+ serviceClassLoader = Thread.currentThread().getContextClassLoader();
+ moduleClassLoader = Thread.currentThread().getContextClassLoader();
+ // setting the dafualt flow , if some one creat AxisConfig programatically
+ // most requird handles will be there in the flow.
+
+ setDefaultGlobalFlow();
+ }
+
+
+ /**
+ * to set the default global flow if some one create a AxisConfiguration by hand.
+ */
+ private void setDefaultGlobalFlow() {
+ 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 org.apache.axis2.engine.InstanceDispatcher();
+ instanceDispatcher.getHandlerDesc().setParent(this);
+
+ postDispatch.addHandler(dispatchingChecker, 0);
+ postDispatch.addHandler(instanceDispatcher, 1);
+ inPhasesUptoAndIncludingPostDispatch.add(postDispatch);
+ }
+
+ public Hashtable getFaultyServices() {
+ return faultyServices;
+ }
+
+ public Hashtable getFaultyModules() {
+ return faultyModules;
+ }
+
+ /**
+ * Method addModule.
*
- * @param name
- * @return Returns AxisService.
+ * @param module
* @throws AxisFault
*/
- public AxisService getService(String name) throws AxisFault;
+ public synchronized void addModule(ModuleDescription module) throws AxisFault {
+ module.setParent(this);
+ modules.put(module.getName(), module);
+ }
/**
* Method addService.
@@ -69,104 +195,363 @@
* @param service
* @throws AxisFault
*/
- public void addService(AxisService service) throws AxisFault;
+ public synchronized void addService(AxisService service) throws AxisFault {
+ AxisServiceGroup axisServiceGroup = new AxisServiceGroup();
+ axisServiceGroup.setServiceGroupName(service.getName().getLocalPart());
+ axisServiceGroup.setParent(this);
+ axisServiceGroup.addService(service);
+ addServiceGroup(axisServiceGroup);
+ }
+
+ public void addServiceGroup(AxisServiceGroup axisServiceGroup) throws AxisFault {
+ Iterator services = axisServiceGroup.getServices();
+ axisServiceGroup.setParent(this);
+ AxisService description;
+ while (services.hasNext()) {
+ description = (AxisService) services.next();
+ if (allservices.get(description.getName().getLocalPart()) != null) {
+ throw new AxisFault("Two services can not have same name, a service with " +
+ description.getName().getLocalPart() + " alredy exist in the system");
+ }
+ }
+ services = axisServiceGroup.getServices();
+ while (services.hasNext()) {
+ description = (AxisService) services.next();
+ allservices.put(description.getName().getLocalPart(), description);
+ notifyObservers(AxisEvent.SERVICE_DEPLOY, description);
+ }
+ Iterator enModule = engagedModules.iterator();
+ while (enModule.hasNext()) {
+ QName moduleDescription = (QName) enModule.next();
+ axisServiceGroup.engageModuleToGroup(moduleDescription);
+ }
+ serviceGroups.put(axisServiceGroup.getServiceGroupName(), axisServiceGroup);
+ }
+
+ /**
+ * Method getModule.
+ *
+ * @param name
+ * @return Returns ModuleDescription.
+ */
+ public ModuleDescription getModule(QName name) {
+ return (ModuleDescription) modules.get(name);
+ }
- //to Add service Groups
- public void addServiceGroup(AxisServiceGroup axisServiceGroup) throws AxisFault;
+ /**
+ * @return Returns HashMap.
+ */
+ public HashMap getModules() {
+ return modules;
+ }
/**
- * Method removeService.
+ * Method getService.
*
* @param name
+ * @return Returns AxisService.
* @throws AxisFault
*/
- public void removeService(String name) throws AxisFault;
+ public AxisService getService(String name) throws AxisFault {
+ return (AxisService) allservices.get(name);
+ }
/**
- * Modules is read only as they can not deployed while running.
+ * Method removeService.
*
* @param name
- * @return Returns ModuleDescription.
+ * @throws AxisFault
*/
- public ModuleDescription getModule(QName name);
+ public synchronized void removeService(String name) throws AxisFault {
+ AxisService service = (AxisService) allservices.remove(name);
+ if (service != null) {
+ log.info("Removed service " + name);
+ }
+ }
+
+ public TransportInDescription getTransportIn(QName name) throws AxisFault {
+ return (TransportInDescription) transportsIn.get(name);
+ }
/**
- * Method addMdoule.
+ * Method addTransportIn.
*
- * @param module
+ * @param transport
* @throws AxisFault
*/
- public void addModule(ModuleDescription module) throws AxisFault;
-
- public boolean isEngaged(QName moduleName);
+ 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);
+ }
/**
- * Engages a module at run time.
+ * Method addTransportOut.
*
- * @param moduleref
+ * @param transport
* @throws AxisFault
*/
- public void engageModule(QName moduleref) throws AxisFault;
-
-
- //
- public HashMap getServices();
+ public synchronized void addTransportOut(TransportOutDescription transport)
+ throws AxisFault {
+ transportsOut.put(transport.getName(), transport);
+ }
+
+ public HashMap getTransportsIn() {
+ return transportsIn;
+ }
+
+ public HashMap getTransportsOut() {
+ return transportsOut;
+ }
/**
- *
+ * Checks whether a given parameter is locked.
+ *
+ * @param parameterName
+ * @return Returns boolean
*/
- public ArrayList getInPhasesUptoAndIncludingPostDispatch();
+ public boolean isParameterLocked(String parameterName) {
+ Parameter parameter = getParameter(parameterName);
+ return parameter != null && parameter.isLocked();
+ }
+
+ public void deserializeParameters(OMElement paramters) throws AxisFault {
+ this.paramInclude.deserializeParameters(paramters);
+ }
+
+ public AxisServiceGroup getServiceGroup(String serviceNameAndGroupString) {
+ return (AxisServiceGroup) serviceGroups.get(serviceNameAndGroupString);
+ }
+
+ public Iterator getServiceGroups() {
+ return serviceGroups.values().iterator();
+ }
+
+ public ArrayList getInPhasesUptoAndIncludingPostDispatch() {
+ return inPhasesUptoAndIncludingPostDispatch;
+ }
//to get the out flow correpodning to the global out flow;
- public ArrayList getGlobalOutPhases();
-
- public void setGlobalOutPhase(ArrayList outPhases);
+ public ArrayList getGlobalOutPhases() {
+ return this.outPhases;
+ }
+
+ public void setGlobalOutPhase(ArrayList outPhases) {
+ this.outPhases = outPhases;
+ }
+
+ public void setInPhasesUptoAndIncludingPostDispatch(ArrayList inPhasesUptoAndIncludingPostDispatch) {
+ this.inPhasesUptoAndIncludingPostDispatch = inPhasesUptoAndIncludingPostDispatch;
+ }
- 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;
+ /**
+ * @return Returns ArrayList
+ */
+ public ArrayList getInFaultFlow() {
+ return inFaultPhases;
+ }
- public HashMap getTransportsIn();
- public HashMap getTransportsOut();
+ /**
+ * @return Returns ArrayList
+ */
+ public ArrayList getOutFaultFlow() {
+ return outFaultPhases;
+ }
- //Checks whether a given parameter is locked.
- public boolean isParameterLocked(String parameterName);
+ /**
+ * @param list
+ */
+ public void setInFaultPhases(ArrayList list) {
+ inFaultPhases = list;
+ }
- public AxisServiceGroup getServiceGroup(String serviceNameAndGroupString);
+ /**
+ * @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);
+ }
- Iterator getServiceGroups();
+ /**
+ * Method getParameter.
+ *
+ * @param name
+ * @return Returns Parameter
+ */
+ public Parameter getParameter(String name) {
+ return paramInclude.getParameter(name);
+ }
+
+ public ArrayList getParameters() {
+ return paramInclude.getParameters();
+ }
- public void notifyObservers(int event_type, AxisService service);
+ /**
+ * Method addParameter.
+ *
+ * @param param
+ */
+ public void addParameter(Parameter param) throws AxisFault {
+ if (isParameterLocked(param.getName())) {
+ throw new AxisFault("Parmter is locked can not overide: " + param.getName());
+ } else {
+ paramInclude.addParameter(param);
+ }
+ }
+ /**
+ * Method getEngagedModules.
+ *
+ * @return Collection
+ */
+ public Collection getEngagedModules() {
+ return engagedModules;
+ }
+
+ public void engageModule(QName moduleref) throws AxisFault {
+ ModuleDescription module = getModule(moduleref);
+ boolean isNewmodule = false;
+ if (module == null) {
+ File file = new ArchiveReader().creatModuleArchivefromResource(
+ moduleref.getLocalPart(), getRepository());
+ module = new DeploymentEngine().buildModule(file, this);
+ isNewmodule = true;
+ }
+ if (module != null) {
+ for (Iterator iterator = engagedModules.iterator();
+ iterator.hasNext();) {
+ QName qName = (QName) iterator.next();
+ if (moduleref.equals(qName)) {
+ log.info("Attempt to engage an already engaged module " + qName);
+ return;
+ }
+ }
+ } else {
+ throw new AxisFault(
+ this + " Refer to invalid module "
+ + moduleref.getLocalPart() +
+ " has not bean deployed yet !");
+ }
+ Iterator servicegroups = getServiceGroups();
+ while (servicegroups.hasNext()) {
+ AxisServiceGroup serviceGroup = (AxisServiceGroup) servicegroups.next();
+ serviceGroup.engageModuleToGroup(module.getName());
+ }
+ if (isNewmodule) {
+ addModule(module);
+ }
+ engagedModules.add(moduleref);
+ }
+
+ //to get all the services in the system
+ public HashMap getServices() {
+ Iterator sgs = getServiceGroups();
+ while (sgs.hasNext()) {
+ AxisServiceGroup axisServiceGroup = (AxisServiceGroup) sgs.next();
+ Iterator servics = axisServiceGroup.getServices();
+ while (servics.hasNext()) {
+ AxisService axisService = (AxisService) servics.next();
+ allservices.put(axisService.getName().getLocalPart(), axisService);
+ }
+ }
+ 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, AxisService 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);
+ }
+ }
//the class loder which become the top most parent of all the modules and services
- public ClassLoader getSystemClassLoader();
-
- public void setSystemClassLoader(ClassLoader classLoader);
+ public ClassLoader getSystemClassLoader() {
+ return this.systemClassLoader;
+ }
+
+ public void setSystemClassLoader(ClassLoader classLoader) {
+ this.systemClassLoader = classLoader;
+ }
// the class loder that become the paranet of all the services
- public ClassLoader getServiceClassLoader();
-
- public void setServiceClassLoader(ClassLoader classLoader);
+ public ClassLoader getServiceClassLoader() {
+ return this.serviceClassLoader;
+ }
+
+ public void setServiceClassLoader(ClassLoader classLoader) {
+ this.serviceClassLoader = classLoader;
+ }
// the class loder that become the paranet of all the moduels
- public ClassLoader getModuleClassLoader();
-
- public void setModuleClassLoader(ClassLoader classLoader);
+ public ClassLoader getModuleClassLoader() {
+ return this.moduleClassLoader;
+ }
+
+ public void setModuleClassLoader(ClassLoader classLoader) {
+ this.moduleClassLoader = classLoader;
+ }
//to set and get host configuration
- void setHostConfiguration(HostConfiguration hostConfiguration);
+ public void setHostConfiguration(HostConfiguration hostConfiguration) {
+ this.hostConfiguration = hostConfiguration;
+ }
+
+ public HostConfiguration getHostConfiguration() {
+ return this.hostConfiguration;
+ }
+
+ public void addObservers(AxisObserver axisObserver) {
+ observersList.add(axisObserver);
+ }
+
- HostConfiguration getHostConfiguration();
+ /**
+ * Adds module configuration, if there is moduleConfig tag in service.
+ *
+ * @param moduleConfiguration
+ */
+ public void addModuleConfig(ModuleConfiguration moduleConfiguration) {
+ moduleConfigmap.put(moduleConfiguration.getModuleName(), moduleConfiguration);
+ }
+
+ public ModuleConfiguration getModuleConfig(QName moduleName) {
+ return (ModuleConfiguration) moduleConfigmap.get(moduleName);
+ }
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java?rev=351567&r1=351566&r2=351567&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java Thu Dec 1 19:50:05 2005
@@ -24,7 +24,7 @@
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.Parameter;
import org.apache.axis2.description.ParameterImpl;
-import org.apache.axis2.engine.AxisConfigurationImpl;
+import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.transport.http.server.AdminAppException;
@@ -272,7 +272,7 @@
private void listModules(HttpServletRequest req, HttpServletResponse res) throws IOException {
HashMap modules =
- ((AxisConfigurationImpl) configContext.getAxisConfiguration()).getModules();
+ ((AxisConfiguration) configContext.getAxisConfiguration()).getModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
req.getSession().setAttribute(Constants.ERROR_MODULE_MAP,
configContext.getAxisConfiguration().getFaultyModules());
@@ -283,7 +283,7 @@
HttpServletResponse res)
throws IOException {
HashMap modules =
- ((AxisConfigurationImpl) configContext.getAxisConfiguration()).getModules();
+ ((AxisConfiguration) configContext.getAxisConfiguration()).getModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
String moduleName = req.getParameter("modules");
req.getSession().setAttribute(Constants.ENGAGE_STATUS, null);
@@ -306,7 +306,7 @@
HttpServletResponse res)
throws IOException {
HashMap modules =
- ((AxisConfigurationImpl) configContext.getAxisConfiguration()).getModules();
+ ((AxisConfiguration) configContext.getAxisConfiguration()).getModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
String moduleName = req.getParameter("modules");
@@ -352,7 +352,7 @@
HttpServletResponse res)
throws IOException {
HashMap modules =
- ((AxisConfigurationImpl) configContext.getAxisConfiguration()).getModules();
+ ((AxisConfiguration) configContext.getAxisConfiguration()).getModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
Iterator services = configContext.getAxisConfiguration().getServiceGroups();
req.getSession().setAttribute(Constants.SERVICE_GROUP_MAP, services);
@@ -377,7 +377,7 @@
HttpServletResponse res)
throws IOException {
HashMap modules =
- ((AxisConfigurationImpl) configContext.getAxisConfiguration()).getModules();
+ ((AxisConfiguration) configContext.getAxisConfiguration()).getModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
HashMap services = configContext.getAxisConfiguration().getServices();
req.getSession().setAttribute(Constants.SERVICE_MAP, services);
@@ -410,7 +410,7 @@
HttpServletResponse res)
throws IOException {
Collection modules =
- ((AxisConfigurationImpl) configContext.getAxisConfiguration()).getEngagedModules();
+ ((AxisConfiguration) configContext.getAxisConfiguration()).getEngagedModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
res.sendRedirect(LIST_GLOABLLY_ENGAGED_MODULES_JSP_NAME);
}
@@ -529,7 +529,7 @@
private void listPhases(HttpServletRequest req, HttpServletResponse res) throws IOException {
ArrayList phaselist = new ArrayList();
- PhasesInfo info = ((AxisConfigurationImpl) configContext.getAxisConfiguration()).getPhasesinfo();
+ PhasesInfo info = ((AxisConfiguration) configContext.getAxisConfiguration()).getPhasesinfo();
phaselist.add(info.getINPhases());
phaselist.add(info.getIN_FaultPhases());
phaselist.add(info.getOUTPhases());