Author: amilas
Date: Thu Mar 11 04:21:41 2010
New Revision: 921685
URL: http://svn.apache.org/viewvc?rev=921685&view=rev
Log:
removing ListnerManager.defaultConfigurationContext and use the
MessageConget.getCurrentMessageContext
inorder to get the configuration context for clients running inside the axis2
server
Modified:
axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/engine/OperationContextSaveTest.java
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/context/ServiceContext.java
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/ListenerManager.java
axis/axis2/java/core/trunk/modules/osgi/src/org/apache/axis2/osgi/deployment/OSGiConfigurationContextFactory.java
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java
Modified:
axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/engine/OperationContextSaveTest.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/engine/OperationContextSaveTest.java?rev=921685&r1=921684&r2=921685&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/engine/OperationContextSaveTest.java
(original)
+++
axis/axis2/java/core/trunk/modules/integration/test/org/apache/axis2/engine/OperationContextSaveTest.java
Thu Mar 11 04:21:41 2010
@@ -329,12 +329,7 @@ public class OperationContextSaveTest ex
assertTrue(comparesOk);
ServiceContext restored_srvCtx =
opctx_restored.getServiceContext();
- comparesOk = restored_srvCtx.isEquivalent(serviceContext);
- log.debug(
- "OperationContextSaveTest:testSaveAndRestore():
ServiceContext equivalency [" +
- comparesOk + "]");
- assertTrue(comparesOk);
-
+
ServiceGroupContext restored_sgCtx =
restored_srvCtx.getServiceGroupContext();
comparesOk = restored_sgCtx.isEquivalent(serviceGroupContext);
log.debug(
Modified:
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/client/ServiceClient.java?rev=921685&r1=921684&r2=921685&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
(original)
+++
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
Thu Mar 11 04:21:41 2010
@@ -147,13 +147,12 @@ public class ServiceClient {
private void configureServiceClient(ConfigurationContext configContext,
AxisService axisService)
throws AxisFault {
if (configContext == null) {
- if (ListenerManager.defaultConfigurationContext == null) {
+ if (MessageContext.getCurrentMessageContext() == null) {
configContext = ConfigurationContextFactory.
createConfigurationContextFromFileSystem(null, null);
- ListenerManager.defaultConfigurationContext = configContext;
createConfigCtx = true;
} else {
- configContext = ListenerManager.defaultConfigurationContext;
+ configContext =
MessageContext.getCurrentMessageContext().getConfigurationContext();
}
}
this.configContext = configContext;
Modified:
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/context/ServiceContext.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/context/ServiceContext.java?rev=921685&r1=921684&r2=921685&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/context/ServiceContext.java
(original)
+++
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/context/ServiceContext.java
Thu Mar 11 04:21:41 2010
@@ -224,22 +224,6 @@ public class ServiceContext extends Abst
this.targetEPR = targetEPR;
}
- public EndpointReference getMyEPR() {
- if (myEPR == null) {
- try {
- if (ListenerManager.defaultConfigurationContext != null) {
- ListenerManager listenerManager =
-
ListenerManager.defaultConfigurationContext.getListenerManager();
- myEPR =
listenerManager.getEPRforService(axisService.getName(), null, null);
- }
- } catch (AxisFault axisFault) {
- // what else I can do
- myEPR = null;
- }
- }
- return myEPR;
- }
-
public void setMyEPR(EndpointReference myEPR) {
this.myEPR = myEPR;
}
@@ -598,64 +582,6 @@ public class ServiceContext extends Abst
/**
- * Compares key parts of the state from the current instance of
- * this class with the specified instance to see if they are
- * equivalent.
- * <p/>
- * This differs from the java.lang.Object.equals() method in
- * that the equals() method generally looks at both the
- * object identity (location in memory) and the object state
- * (data).
- * <p/>
- *
- * @param ctx
- * @return TRUE if this object is equivalent with the specified object
- * that is, key fields match
- * FALSE, otherwise
- */
- public boolean isEquivalent(ServiceContext ctx) {
- // NOTE: the input object is expected to exist (ie, be non-null)
-
- if (!this.axisService.equals(ctx.getAxisService())) {
- return false;
- }
-
-
- EndpointReference targetEPR2 = ctx.getTargetEPR();
-
- if ((this.targetEPR != null) && (targetEPR2 != null)) {
- if (!this.targetEPR.isEquivalent(targetEPR2)) {
- return false;
- }
- } else if ((this.targetEPR == null) && (targetEPR2 == null)) {
- // keep going
- } else {
- // one of the objects is null
- return false;
- }
-
- EndpointReference myEPR2 = ctx.getMyEPR();
-
- if ((this.myEPR != null) && (myEPR2 != null)) {
- if (!this.myEPR.isEquivalent(myEPR2)) {
- return false;
- }
- } else if ((this.myEPR == null) && (myEPR2 == null)) {
- // keep going
- } else {
- // one of the objects is null
- return false;
- }
-
- // TODO: consider checking the parent objects for equivalency
-
- // TODO: consider checking fields from the super class for equivalency
-
- return true;
- }
-
-
- /**
* Get the ID associated with this object instance.
*
* @return A string that can be output to a log file as an identifier
Modified:
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/ListenerManager.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/ListenerManager.java?rev=921685&r1=921684&r2=921685&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/ListenerManager.java
(original)
+++
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/ListenerManager.java
Thu Mar 11 04:21:41 2010
@@ -38,14 +38,8 @@ public class ListenerManager {
private static final OnDemandLogger log = new
OnDemandLogger(ListenerManager.class);
- public static ConfigurationContext defaultConfigurationContext;
protected ListenerManagerShutdownThread shutdownHookThread = null;
- public static ListenerManager getDefaultListenerManager() {
- if (defaultConfigurationContext == null) return null;
- return defaultConfigurationContext.getListenerManager();
- }
-
private ConfigurationContext configctx;
private HashMap<String, TransportListener> startedTransports =
new HashMap<String, TransportListener>();
@@ -297,7 +291,6 @@ public class ListenerManager {
this.startedTransports.clear();
this.configctx = null;
- defaultConfigurationContext = null;
}
public boolean isShutdownHookRequired() {
Modified:
axis/axis2/java/core/trunk/modules/osgi/src/org/apache/axis2/osgi/deployment/OSGiConfigurationContextFactory.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/osgi/src/org/apache/axis2/osgi/deployment/OSGiConfigurationContextFactory.java?rev=921685&r1=921684&r2=921685&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/osgi/src/org/apache/axis2/osgi/deployment/OSGiConfigurationContextFactory.java
(original)
+++
axis/axis2/java/core/trunk/modules/osgi/src/org/apache/axis2/osgi/deployment/OSGiConfigurationContextFactory.java
Thu Mar 11 04:21:41 2010
@@ -94,7 +94,6 @@ public class OSGiConfigurationContextFac
ListenerManager listenerManager = new ListenerManager();
listenerManager.init(configCtx);
listenerManager.start();
- ListenerManager.defaultConfigurationContext = configCtx;
}
public void updated(Dictionary dictionary) throws ConfigurationException {
Modified:
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java?rev=921685&r1=921684&r2=921685&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java
(original)
+++
axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java
Thu Mar 11 04:21:41 2010
@@ -127,6 +127,7 @@ public class AxisServlet extends HttpSer
//set the initial buffer for a larger value
response.setBufferSize(BUFFER_SIZE);
+
preprocessRequest(request);
MessageContext msgContext;
@@ -475,7 +476,6 @@ public class AxisServlet extends HttpSer
ListenerManager listenerManager = new ListenerManager();
listenerManager.init(configContext);
listenerManager.start();
- ListenerManager.defaultConfigurationContext = configContext;
agent = new ListingAgent(configContext);
initParams();