Author: deepal
Date: Mon Aug 7 21:30:49 2006
New Revision: 429562
URL: http://svn.apache.org/viewvc?rev=429562&view=rev
Log:
- fixing a problem of invoking fault out flow twice
- DependencyManager uses Service class
Modified:
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Service.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/PhasesInfo.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DependencyManager.java
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Service.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Service.java?rev=429562&r1=429561&r2=429562&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Service.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Service.java Mon Aug 7
21:30:49 2006
@@ -29,6 +29,7 @@
/**
* this will be called during the initialization of the service. If the service is in
the application scope, then this
* method will be called when the system starts up. Else will be called when the first
request comes.
+ *
* @param sc
*/
public void init(ServiceContext sc);
@@ -42,8 +43,10 @@
public void setOperationContext(OperationContext operationContext);
/**
- * This method is called when the service is destroyed.
+ * If the service is in the application scope, then this
+ * method will be called when the system shoutdown up. Else will be called when ever
session finshes.
+ *
* @param sc
*/
- public void destroy(ServiceContext sc);
+ void destroy(ServiceContext sc);
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/PhasesInfo.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/PhasesInfo.java?rev=429562&r1=429561&r2=429562&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/PhasesInfo.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/PhasesInfo.java
Mon Aug 7 21:30:49 2006
@@ -120,16 +120,19 @@
*/
ArrayList globalPhaseList = new ArrayList();
+ boolean messageOut = false;
for (int i = 0; i < OUTPhases.size(); i++) {
Phase phase = (Phase) OUTPhases.get(i);
String phaseName = phase.getPhaseName();
-
- if (PhaseMetadata.PHASE_POLICY_DETERMINATION.equals(phaseName)
- || PhaseMetadata.PHASE_MESSAGE_OUT.equals(phaseName)) {
+ if (!messageOut) {
+ if (PhaseMetadata.PHASE_MESSAGE_OUT.equals(phaseName)) {
+ messageOut = true;
+ globalPhaseList.add(copyPhase(phase));
+ }
+ } else {
globalPhaseList.add(copyPhase(phase));
}
}
-
return globalPhaseList;
}
@@ -147,12 +150,16 @@
public ArrayList getOUT_FaultPhases() throws DeploymentException {
ArrayList globalPhaseList = new ArrayList();
+ boolean messageOut = false;
for (int i = 0; i < OUT_FaultPhases.size(); i++) {
Phase phase = (Phase) OUT_FaultPhases.get(i);
String phaseName = phase.getPhaseName();
-
- if (PhaseMetadata.PHASE_POLICY_DETERMINATION.equals(phaseName)
- || PhaseMetadata.PHASE_MESSAGE_OUT.equals(phaseName)) {
+ if (!messageOut) {
+ if (PhaseMetadata.PHASE_MESSAGE_OUT.equals(phaseName)) {
+ messageOut = true;
+ globalPhaseList.add(copyPhase(phase));
+ }
+ } else {
globalPhaseList.add(copyPhase(phase));
}
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java?rev=429562&r1=429561&r2=429562&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
Mon Aug 7 21:30:49 2006
@@ -17,12 +17,10 @@
package org.apache.axis2.engine;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
import org.apache.axis2.deployment.util.PhasesInfo;
import org.apache.axis2.description.*;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.phaseresolver.PhaseResolver;
-import org.apache.axis2.util.SessionUtils;
import org.apache.axis2.util.Utils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -491,7 +489,7 @@
public List getGlobalModules() {
return globalModuleList;
}
-
+
public Hashtable getFaultyModules() {
return faultyModules;
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DependencyManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DependencyManager.java?rev=429562&r1=429561&r2=429562&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DependencyManager.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DependencyManager.java
Mon Aug 7 21:30:49 2006
@@ -81,18 +81,23 @@
public static void initServiceClass(Object obj,
ServiceContext serviceContext) throws AxisFault {
try {
- Class classToLoad = obj.getClass();
- // We can not call classToLoad.getDeclaredMethed() , since there
- // can be insatnce where mutiple services extends using one class
- // just for init and other reflection methods
- Method[] methods = classToLoad.getMethods();
-
- for (int i = 0; i < methods.length; i++) {
- if (SERVICE_INIT_METHOD.equals(methods[i].getName())
- && (methods[i].getParameterTypes().length == 1)
- && (methods[i].getParameterTypes()[0] == ServiceContext.class))
{
- methods[i].invoke(obj, new Object[]{serviceContext});
- break;
+ if (obj instanceof Service) {
+ Service service = (Service) obj;
+ service.init(serviceContext);
+ } else {
+ Class classToLoad = obj.getClass();
+ // We can not call classToLoad.getDeclaredMethed() , since there
+ // can be insatnce where mutiple services extends using one class
+ // just for init and other reflection methods
+ Method[] methods = classToLoad.getMethods();
+
+ for (int i = 0; i < methods.length; i++) {
+ if (SERVICE_INIT_METHOD.equals(methods[i].getName())
+ && (methods[i].getParameterTypes().length == 1)
+ && (methods[i].getParameterTypes()[0] == ServiceContext.class))
{
+ methods[i].invoke(obj, new Object[]{serviceContext});
+ break;
+ }
}
}
} catch (SecurityException e) {
@@ -144,17 +149,22 @@
Object obj = serviceContext.getProperty(ServiceContext.SERVICE_OBJECT);
if (obj != null) {
Class classToLoad = obj.getClass();
- // We can not call classToLoad.getDeclaredMethed() , since there
- // can be insatnce where mutiple services extends using one class
- // just for init and other reflection methods
- Method[] methods = classToLoad.getMethods();
-
- for (int i = 0; i < methods.length; i++) {
- if (SERVICE_DESTROY_METHOD.equals(methods[i].getName())
- && (methods[i].getParameterTypes().length == 1)
- && (methods[i].getParameterTypes()[0] == ServiceContext.class))
{
- methods[i].invoke(obj, new Object[]{serviceContext});
- break;
+ if (obj instanceof Service) {
+ Service service = (Service) obj;
+ service.destroy(serviceContext);
+ } else {
+ // We can not call classToLoad.getDeclaredMethed() , since there
+ // can be insatnce where mutiple services extends using one class
+ // just for init and other reflection methods
+ Method[] methods = classToLoad.getMethods();
+
+ for (int i = 0; i < methods.length; i++) {
+ if (SERVICE_DESTROY_METHOD.equals(methods[i].getName())
+ && (methods[i].getParameterTypes().length == 1)
+ && (methods[i].getParameterTypes()[0] == ServiceContext.class))
{
+ methods[i].invoke(obj, new Object[]{serviceContext});
+ break;
+ }
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org
|