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/04/11 13:36:29 UTC
svn commit: r160861 - in webservices/axis/trunk/java/modules/core:
samples/deployment/service1/META-INF/ src/org/apache/axis/client/
src/org/apache/axis/clientapi/ src/org/apache/axis/deployment/
src/org/apache/axis/description/ test/org/apache/axis/deployment/
Author: deepal
Date: Mon Apr 11 04:36:27 2005
New Revision: 160861
URL: http://svn.apache.org/viewcvs?view=rev&rev=160861
Log:
refactoring
Modified:
webservices/axis/trunk/java/modules/core/samples/deployment/service1/META-INF/service.xml
webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/Call.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Call.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisService.java
webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/TransportDeploymentTest.java
Modified: webservices/axis/trunk/java/modules/core/samples/deployment/service1/META-INF/service.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/samples/deployment/service1/META-INF/service.xml?view=diff&r1=160860&r2=160861
==============================================================================
--- webservices/axis/trunk/java/modules/core/samples/deployment/service1/META-INF/service.xml (original)
+++ webservices/axis/trunk/java/modules/core/samples/deployment/service1/META-INF/service.xml Mon Apr 11 04:36:27 2005
@@ -1,14 +1,18 @@
-<service provider="org.apache.axis.sample.echo.EchoProvider" style="rpc" contextPath="services">
- <java:implementation class="org.apache.axis.sample.echo.EchoImpl" xmlns:java="http://ws.apache.org/axis2/deployment/java"/>
+<service messageReceiver="org.apache.axis.receivers.InOutSyncReceiver" style="rpc" contextPath="services">
+
+ <parameter name="ServiceClass" locked="xsd:false">org.apache.axis.sample.echo.EchoImpl</parameter>
+
<inflow>
<handler name="logging" class="org.apache.axis.sample.handlers.LoggingHandler">
<order phase="Logging" phaseFirst="true"/>
- </handler>
+ </handler>
</inflow>
+
<outflow/>
<faultflow>
<handler name="logging2" class="org.apache.axis.sample.handlers.LoggingHandler"/>
</faultflow>
+
<operation name="echoString"/>
<operation name="echoStringArray"/>
<operation name="echoEchoStruct"/>
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/Call.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/Call.java?view=diff&r1=160860&r2=160861
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/Call.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/client/Call.java Mon Apr 11 04:36:27 2005
@@ -40,31 +40,24 @@
//find the deployment mechanism , create
//a EngineContext .. if the conf file not found
//deafult one is used
- properties = new HashMap();
- this.engineContext = new EngineContext();
init();
}
public Call(InputStream in) throws AxisFault {
- properties = new HashMap();
- this.engineContext = new EngineContext();
init();
}
public Call(File inFile) throws AxisFault {
try {
InputStream in =new FileInputStream(inFile);
- properties = new HashMap();
- this.engineContext = new EngineContext();
init();
} catch (FileNotFoundException e) {
throw new AxisFault("FileNotFound " + e.getMessage());
}
}
- public Call(EngineContext engineContext){
- this.properties =new HashMap();
- this.engineContext = engineContext;
+ public Call(EngineContext engineContext) throws AxisFault {
+ init();
}
public SOAPEnvelope sendReciveAsync(SOAPEnvelope env,Callback callback) throws AxisFault {
@@ -157,9 +150,10 @@
*/
private void init() throws AxisFault{
try{
+ properties = new HashMap();
+ this.engineContext = new EngineContext();
AxisService serive = new AxisService();
serive.setName(new QName(ClientService.SERVIC_NAME));
- ClientService sc = new ClientService();
Class serviceclass = Class.forName("org.apache.axis.client.ClientService");
serive.setServiceClass(serviceclass);
}catch(ClassNotFoundException e){
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Call.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Call.java?view=diff&r1=160860&r2=160861
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Call.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Call.java Mon Apr 11 04:36:27 2005
@@ -64,9 +64,9 @@
// only used in SendReciveAync , to get the response
/**
- * Field Listenertransport
+ * Field listenertransport
*/
- private String Listenertransport;
+ private String listenertransport;
// the type of transport that the request should be send throgh
@@ -112,7 +112,7 @@
throw new AxisFault(e.getMessage(),e);
}
- Listenertransport = null;
+ listenertransport = null;
transport = Constants.TRANSPORT_HTTP;
}
@@ -154,7 +154,7 @@
if ((Constants.TRANSPORT_HTTP.equals(transport)
|| Constants.TRANSPORT_MAIL.equals(transport)
|| Constants.TRANSPORT_TCP.equals(transport))) {
- this.Listenertransport = Listenertransport;
+ this.listenertransport = Listenertransport;
this.useSeparateListener = useSeparateListener;
} else {
throw new AxisFault("Selected transport dose not suppot ( " + transport + " )");
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java?view=diff&r1=160860&r2=160861
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java Mon Apr 11 04:36:27 2005
@@ -27,6 +27,7 @@
import org.apache.axis.engine.*;
import org.apache.axis.phaseresolver.PhaseException;
import org.apache.axis.phaseresolver.PhaseResolver;
+import org.apache.axis.context.EngineContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -39,6 +40,7 @@
public class DeploymentEngine implements DeploymentConstants {
+
private Log log = LogFactory.getLog(getClass());
private static Scheduler scheduler;
@@ -61,7 +63,7 @@
* this ref will pass to engine when it call start()
* method
*/
- private EngineConfiguration engineRegistry;
+ private EngineConfiguration engineconfig;
/**
* this constaructor for the testing
@@ -97,10 +99,10 @@
* this constructor is used to deploy a web service programatically, by using classLoader
* and InputStream
*
- * @param engineRegistry
+ * @param engineconfig
*/
- public DeploymentEngine(EngineConfiguration engineRegistry) {
- this.engineRegistry = engineRegistry;
+ public DeploymentEngine(EngineConfiguration engineconfig) {
+ this.engineconfig = engineconfig;
}
public DeploymentEngine(String RepositaryName, String serverXMLFile) throws DeploymentException {
@@ -157,8 +159,8 @@
*
* @return
*/
- public EngineConfiguration getEngineRegistry() {
- return engineRegistry;
+ public EngineConfiguration getEngineconfig() {
+ return engineconfig;
}
/**
@@ -167,7 +169,7 @@
* @return
* @throws AxisFault
*/
- public EngineConfiguration start() throws AxisFault, DeploymentException, XMLStreamException {
+ public EngineContext start() throws AxisFault, DeploymentException, XMLStreamException {
//String fileName;
if (serverConfigName == null) {
throw new DeploymentException("path to Server.xml can not be NUll");
@@ -175,7 +177,7 @@
File tempfile = new File(serverConfigName);
try {
InputStream in = new FileInputStream(tempfile);
- engineRegistry = createEngineRegistry();
+ engineconfig = createEngineRegistry();
DeploymentParser parser = new DeploymentParser(in, this);
parser.procesServerXML(server);
} catch (FileNotFoundException e) {
@@ -192,8 +194,7 @@
} catch (PhaseException e) {
log.info("Module validation failed" + e.getMessage());
}
-
- return engineRegistry;
+ return new EngineContext(engineconfig);
}
/**
@@ -228,14 +229,14 @@
throw new AxisFault(server + " Refer to invalid module " + qName + " has not bean deployed yet !");
}
}
- PhaseResolver phaseResolver = new PhaseResolver(engineRegistry);
+ PhaseResolver phaseResolver = new PhaseResolver(engineconfig);
phaseResolver.buildGlobalChains(server);
phaseResolver.buildTranspotsChains();
}
public AxisModule getModule(QName moduleName) throws AxisFault {
- AxisModule metaData = engineRegistry.getModule(moduleName);
+ AxisModule metaData = engineconfig.getModule(moduleName);
return metaData;
}
@@ -261,7 +262,7 @@
private void addnewService(AxisService serviceMetaData) throws AxisFault, PhaseException {
currentFileItem.setClassLoader();
serviceMetaData = getRunnableService(serviceMetaData);
- engineRegistry.addService(serviceMetaData);
+ engineconfig.addService(serviceMetaData);
Parameter para = serviceMetaData.getParameter("OUTSERVICE");
if (para != null) {
String value = (String) para.getValue();
@@ -305,7 +306,7 @@
if (faultFlow != null) {
addFlowHandlers(faultFlow);
}
- PhaseResolver reolve = new PhaseResolver(engineRegistry, serviceMetaData);
+ PhaseResolver reolve = new PhaseResolver(engineconfig, serviceMetaData);
reolve.buildchains();
serviceMetaData.setClassLoader(currentFileItem.getClassLoader());
return serviceMetaData;
@@ -325,6 +326,7 @@
String readInProviderName = currentFileItem.getProvideName();
if (readInProviderName != null && !"".equals(readInProviderName)) {
Class provider = Class.forName(currentFileItem.getProvideName(), true, loader1);
+
service.setMessageReceiver((Provider) provider.newInstance());
}
} catch (Exception e) {
@@ -382,7 +384,7 @@
Flow faultFlow = moduelmetada.getFaultFlow();
addFlowHandlers(faultFlow);
- engineRegistry.addMdoule(moduelmetada);
+ engineconfig.addMdoule(moduelmetada);
}
@@ -430,7 +432,7 @@
serviceStatus = "Error:\n" + e.getMessage();
} finally {
if (serviceStatus.startsWith("Error:")) {
- engineRegistry.getFaulytServices().put(getAxisServiceName(currentFileItem.getName()), serviceStatus);
+ engineconfig.getFaulytServices().put(getAxisServiceName(currentFileItem.getName()), serviceStatus);
}
currentFileItem = null;
}
@@ -467,10 +469,10 @@
WSInfo wsInfo = (WSInfo) wsToUnDeploy.get(i);
if (wsInfo.getType() == SERVICE) {
serviceName = getAxisServiceName(wsInfo.getFilename());
- engineRegistry.removeService(new QName(serviceName));
+ engineconfig.removeService(new QName(serviceName));
log.info("UnDeployement WS Name " + wsInfo.getFilename());
}
- engineRegistry.getFaulytServices().remove(serviceName);
+ engineconfig.getFaulytServices().remove(serviceName);
}
}
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java?view=diff&r1=160860&r2=160861
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java Mon Apr 11 04:36:27 2005
@@ -136,10 +136,10 @@
serverMetaData.addParameter(parameter);
} else if (TRANSPORTSENDER.equals(ST)) {
AxisTransportOut transportout = proccessTrasnsportOUT();
- dpengine.getEngineRegistry().addTransportOut(transportout);
+ dpengine.getEngineconfig().addTransportOut(transportout);
} else if (TRANSPORTRECEIVER.equals(ST)) {
AxisTransportIn transportin = proccessTrasnsportIN();
- dpengine.getEngineRegistry().addTransportIn(transportin);
+ dpengine.getEngineconfig().addTransportIn(transportin);
} else if (TYPEMAPPINGST.equals(ST)) {
throw new UnsupportedOperationException("Type Mappings are not allowed in server.xml");
} else if (MODULEST.equals(ST)) {
@@ -161,11 +161,11 @@
String attvalue = pullparser.getAttributeValue(i);
if (TYPE.equals(attname)) {
if(INFLOWST.equals(attvalue)){
- dpengine.getEngineRegistry().setInPhases(processPhaseOrder());
+ dpengine.getEngineconfig().setInPhases(processPhaseOrder());
} else if (OUTFLOWST.equals(attvalue)){
- dpengine.getEngineRegistry().setOutPhases(processPhaseOrder());
+ dpengine.getEngineconfig().setOutPhases(processPhaseOrder());
} else if (FAILTFLOWST.equals(attvalue)){
- dpengine.getEngineRegistry().setFaultPhases(processPhaseOrder());
+ dpengine.getEngineconfig().setFaultPhases(processPhaseOrder());
} else {
throw new DeploymentException("un defined flow type " + ST);
}
@@ -174,7 +174,7 @@
} else {
throw new DeploymentException("Flow type is a required attribute in " + ST);
}
- //((EngineRegistryImpl) dpengine.getEngineRegistry()).setPhases(processPhaseOrder());
+ //((EngineRegistryImpl) dpengine.getEngineconfig()).setPhases(processPhaseOrder());
} else if (SERVERST.equals(ST)) {
//TODO process attributes
} else {
@@ -327,27 +327,17 @@
*/
private void procesServiceXML(AxisService axisService) throws DeploymentException {
int attribCount = pullparser.getAttributeCount();
- boolean proviceFound = false;
if (attribCount >= 1) {
for (int i = 0; i < attribCount; i++) {
String attname = pullparser.getAttributeLocalName(i);
String attvalue = pullparser.getAttributeValue(i);
- if (PROVIDERNAME.equals(attname)) {
- if (dpengine != null && dpengine.getCurrentFileItem() != null) {
- dpengine.getCurrentFileItem().setProvideName(attvalue);
- proviceFound = true;
- }
- } else if (STYLENAME.equals(attname)) {
+ if (STYLENAME.equals(attname)) {
axisService.setStyle(attvalue);
- //TODO setStyle should be handle latter
} else if (CONTEXTPATHNAME.equals(attname)) {
axisService.setContextPath(getValue(attvalue));
} else {
throw new DeploymentException("Bad arguments for the service" + axisService.getName());
}
- }
- if (!proviceFound) {
- throw new DeploymentException("Provider class has not been specified");
}
} else
throw new DeploymentException("Bad arguments" + axisService.getName());
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisService.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisService.java?view=diff&r1=160860&r2=160861
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisService.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisService.java Mon Apr 11 04:36:27 2005
@@ -187,11 +187,6 @@
* @see org.apache.axis.description.AxisService#setProvider(org.apache.axis.engine.Provider)
*/
- /**
- * Method setProvider
- *
- * @param provider
- */
public void setMessageReceiver(MessageReceiver receiver) {
if (receiver != null) {
this.setComponentProperty(MESSAGE_RECIVER_KEY, receiver);
Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/TransportDeploymentTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/TransportDeploymentTest.java?view=diff&r1=160860&r2=160861
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/TransportDeploymentTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/deployment/TransportDeploymentTest.java Mon Apr 11 04:36:27 2005
@@ -37,7 +37,7 @@
public void testTransports() throws AxisFault, PhaseException, DeploymentException, XMLStreamException {
DeploymentEngine engine = new DeploymentEngine(testResourceDir + "/deployment", "server-transport.xml");
engine.start();
- EngineConfiguration er = engine.getEngineRegistry();
+ EngineConfiguration er = engine.getEngineconfig();
AxisTransportIn transport = er.getTransportIn(new QName("http"));
assertNotNull(transport);
assertNotNull(transport.getInFlow());