You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by va...@apache.org on 2008/12/16 22:10:02 UTC
svn commit: r727152 - in
/ode/trunk/axis2/src/main/java/org/apache/ode/axis2: ODEService.java
hooks/SessionInHandler.java hooks/SessionOutHandler.java
soapbinding/SoapExternalService.java
Author: vanto
Date: Tue Dec 16 13:10:02 2008
New Revision: 727152
URL: http://svn.apache.org/viewvc?rev=727152&view=rev
Log:
Small refactoring of string keys to constants
Modified:
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionInHandler.java
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionOutHandler.java
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/soapbinding/SoapExternalService.java
Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java?rev=727152&r1=727151&r2=727152&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java Tue Dec 16 13:10:02 2008
@@ -58,8 +58,10 @@
* @author Matthieu Riou <mriou at apache dot org>
*/
public class ODEService {
+ private static final Log __log = LogFactory.getLog(ODEService.class);
- private static final Log __log = LogFactory.getLog(ODEService.class);
+ public static final String TARGET_SESSION_ENDPOINT = "targetSessionEndpoint";
+ public static final String CALLBACK_SESSION_ENDPOINT = "callbackSessionEndpoint";
private AxisService _axisService;
private BpelServer _server;
@@ -192,8 +194,8 @@
* Extracts endpoint information from Axis MessageContext (taken from WSA headers) to stuff them into ODE mesage exchange.
*/
private void readHeader(MessageContext msgContext, MyRoleMessageExchange odeMex) {
- Object otse = msgContext.getProperty("targetSessionEndpoint");
- Object ocse = msgContext.getProperty("callbackSessionEndpoint");
+ Object otse = msgContext.getProperty(TARGET_SESSION_ENDPOINT);
+ Object ocse = msgContext.getProperty(CALLBACK_SESSION_ENDPOINT);
if (otse != null) {
Element serviceEpr = (Element) otse;
WSAEndpoint endpoint = new WSAEndpoint();
@@ -228,7 +230,7 @@
// information (if available).
if (odeMex.getProperty(MessageExchange.PROPERTY_SEP_MYROLE_SESSIONID) != null) {
_serviceRef.setSessionId(odeMex.getProperty(MessageExchange.PROPERTY_SEP_MYROLE_SESSIONID));
- msgContext.setProperty("callbackSessionEndpoint", _serviceRef);
+ msgContext.setProperty(CALLBACK_SESSION_ENDPOINT, _serviceRef);
}
}
Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionInHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionInHandler.java?rev=727152&r1=727151&r2=727152&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionInHandler.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionInHandler.java Tue Dec 16 13:10:02 2008
@@ -26,6 +26,7 @@
import org.apache.axis2.handlers.AbstractHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.ode.axis2.ODEService;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.Namespaces;
import org.w3c.dom.Document;
@@ -38,7 +39,7 @@
* context.
*/
public class SessionInHandler extends AbstractHandler {
- private static final long serialVersionUID = -806564877582696569L;
+ private static final long serialVersionUID = -806564877582696569L;
private static final Log __log = LogFactory.getLog(SessionInHandler.class);
@@ -69,7 +70,7 @@
}
if (__log.isDebugEnabled())
__log.debug("Constructed a TO endpoint: " + DOMUtils.domToString(serviceEpr));
- messageContext.setProperty("targetSessionEndpoint", serviceEpr);
+ messageContext.setProperty(TARGET_SESSION_ENDPOINT, serviceEpr);
}
// Seeing if there's a callback, in case our client would be stateful as well
@@ -96,7 +97,7 @@
}
if (__log.isDebugEnabled())
__log.debug("Constructed a CALLBACK endpoint: " + DOMUtils.domToString(serviceEpr));
- messageContext.setProperty("callbackSessionEndpoint", serviceEpr);
+ messageContext.setProperty(ODEService.CALLBACK_SESSION_ENDPOINT, serviceEpr);
}
}
}
Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionOutHandler.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionOutHandler.java?rev=727152&r1=727151&r2=727152&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionOutHandler.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionOutHandler.java Tue Dec 16 13:10:02 2008
@@ -32,6 +32,7 @@
import org.apache.ode.il.epr.EndpointFactory;
import org.apache.ode.il.epr.MutableEndpoint;
import org.apache.ode.il.epr.WSAEndpoint;
+import org.apache.ode.axis2.ODEService;
import org.apache.ode.bpel.iapi.EndpointReference;
import org.apache.ode.utils.Namespaces;
@@ -46,12 +47,12 @@
public InvocationResponse invoke(MessageContext messageContext) throws AxisFault {
- EndpointReference otargetSession = (EndpointReference) messageContext.getProperty("targetSessionEndpoint");
- EndpointReference ocallbackSession = (EndpointReference) messageContext.getProperty("callbackSessionEndpoint");
+ EndpointReference otargetSession = (EndpointReference) messageContext.getProperty(ODEService.TARGET_SESSION_ENDPOINT);
+ EndpointReference ocallbackSession = (EndpointReference) messageContext.getProperty(ODEService.CALLBACK_SESSION_ENDPOINT);
if (otargetSession == null)
- otargetSession = (EndpointReference) messageContext.getOptions().getProperty("targetSessionEndpoint");
+ otargetSession = (EndpointReference) messageContext.getOptions().getProperty(ODEService.TARGET_SESSION_ENDPOINT);
if (ocallbackSession == null)
- ocallbackSession = (EndpointReference) messageContext.getOptions().getProperty("callbackSessionEndpoint");
+ ocallbackSession = (EndpointReference) messageContext.getOptions().getProperty(ODEService.CALLBACK_SESSION_ENDPOINT);
if (otargetSession != null || ocallbackSession != null) {
SOAPHeader header = messageContext.getEnvelope().getHeader();
Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/soapbinding/SoapExternalService.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/soapbinding/SoapExternalService.java?rev=727152&r1=727151&r2=727152&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/soapbinding/SoapExternalService.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/soapbinding/SoapExternalService.java Tue Dec 16 13:10:02 2008
@@ -274,7 +274,7 @@
}
targetEPR.setSessionId(partnerSessionId);
}
- options.setProperty("targetSessionEndpoint", targetEPR);
+ options.setProperty(ODEService.TARGET_SESSION_ENDPOINT, targetEPR);
if (myRoleEPR != null) {
if (myRoleSessionId != null) {
@@ -283,7 +283,7 @@
}
myRoleEPR.setSessionId(myRoleSessionId);
}
- options.setProperty("callbackSessionEndpoint", odeMex.getMyRoleEndpointReference());
+ options.setProperty(ODEService.CALLBACK_SESSION_ENDPOINT, odeMex.getMyRoleEndpointReference());
} else {
__log.debug("My-Role EPR not specified, SEP will not be used.");
}