You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2005/07/11 17:49:55 UTC
svn commit: r210150 [3/35] - in /webservices/axis/trunk/java: ./ etc/
modules/addressing/
modules/addressing/src/org/apache/axis2/handlers/addressing/
modules/addressing/test-resources/
modules/addressing/test/org/apache/axis2/handlers/addressing/ modu...
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java Mon Jul 11 08:49:30 2005
@@ -39,8 +39,8 @@
import java.io.IOException;
/**
- * This Class capture handling the In-Out type Method invocations. this provides the
- * methods to do blocking and non blocking invocation. The basic API is based on the
+ * This Class capture handling the In-Out type Method invocations. this provides the
+ * methods to do blocking and non blocking invocation. The basic API is based on the
* MessageContext and the more convients API is provided by the Call
*/
public class InOutMEPClient extends MEPClient {
@@ -51,12 +51,12 @@
protected TransportOutDescription senderTransport;
protected TransportInDescription listenerTransport;
- /**
+ /**
* Should the two SOAPMessage are sent over same channel over seperate channels.
* The value of this variable depends on the transport specified.
- * e.g. If the transports are different this is true by default.
- * HTTP transport support both cases
- * SMTP transport support only two channel case
+ * e.g. If the transports are different this is true by default.
+ * HTTP transport support both cases
+ * SMTP transport support only two channel case
*/
protected boolean useSeparateListener = false;
@@ -69,28 +69,29 @@
//variables use for internal implementations
/**
- * This is used for the Receiving the Async Messages
+ * This is used for the Receiving the Async Messages
*/
protected CallbackReceiver callbackReceiver;
+
/**
* This accepts a ServiceContext, and the ServiceContext should have all the parents set in to it right
- * Ideall this should be generated from a WSDL, we do not have it yet.
- *
+ * Ideall this should be generated from a WSDL, we do not have it yet.
+ * <p/>
* Follwoing code works for the time been
* <code>
- * ConfigurationContextFactory efac = new ConfigurationContextFactory();
- ConfigurationContext sysContext = efac.buildClientConfigurationContext(null);
- // above line "null" may be a file name if you know the client repssitory
-
- //create new service
- QName assumedServiceName = new QName("Your Service");
- ServiceDescription axisService = new ServiceDescription(assumedServiceName);
- sysContext.getEngineConfig().addService(axisService);
- ServiceContext service = sysContext.createServiceContext(assumedServiceName);
- return service;
- *
+ * ConfigurationContextFactory efac = new ConfigurationContextFactory();
+ * ConfigurationContext sysContext = efac.buildClientConfigurationContext(null);
+ * // above line "null" may be a file name if you know the client repssitory
+ * <p/>
+ * //create new service
+ * QName assumedServiceName = new QName("Your Service");
+ * ServiceDescription axisService = new ServiceDescription(assumedServiceName);
+ * sysContext.getEngineConfig().addService(axisService);
+ * ServiceContext service = sysContext.createServiceContext(assumedServiceName);
+ * return service;
+ * <p/>
* </code>
- *
+ *
* @param serviceContext
*/
@@ -107,8 +108,8 @@
// }
public MessageContext invokeBlocking(OperationDescription axisop, final MessageContext msgctx)
- throws AxisFault {
- verifyInvocation(axisop,msgctx);
+ throws AxisFault {
+ verifyInvocation(axisop, msgctx);
if (useSeparateListener) {
SyncCallBack callback = new SyncCallBack();
invokeNonBlocking(axisop, msgctx, callback);
@@ -146,11 +147,9 @@
ConfigurationContext sysContext = serviceContext.getEngineContext();
AxisConfiguration registry = sysContext.getAxisConfiguration();
- msgctx.setOperationContext(
- OperationContextFactory.createMEPContext(
- WSDLConstants.MEP_CONSTANT_IN_OUT,
- axisop,
- serviceContext));
+ msgctx.setOperationContext(OperationContextFactory.createMEPContext(WSDLConstants.MEP_CONSTANT_IN_OUT,
+ axisop,
+ serviceContext));
MessageContext response = TwoChannelBasedSender.send(msgctx, listenerTransport);
SOAPEnvelope resenvelope = response.getEnvelope();
@@ -162,12 +161,11 @@
}
}
- public void invokeNonBlocking(
- final OperationDescription axisop,
- final MessageContext msgctx,
- final Callback callback)
- throws AxisFault {
- verifyInvocation(axisop,msgctx);
+ public void invokeNonBlocking(final OperationDescription axisop,
+ final MessageContext msgctx,
+ final Callback callback)
+ throws AxisFault {
+ verifyInvocation(axisop, msgctx);
msgctx.setTo(to);
try {
final ConfigurationContext syscontext = serviceContext.getEngineContext();
@@ -182,18 +180,15 @@
msgctx.setMessageID(messageID);
axisop.setMessageReciever(callbackReceiver);
callbackReceiver.addCallback(messageID, callback);
- msgctx.setReplyTo(
- ListenerManager.replyToEPR(
- serviceContext.getServiceConfig().getName().getLocalPart()
- + "/"
- + axisop.getName().getLocalPart(),
- listenerTransport.getName().getLocalPart()));
+ msgctx.setReplyTo(ListenerManager.replyToEPR(serviceContext.getServiceConfig().getName().getLocalPart()
+ + "/"
+ + axisop.getName().getLocalPart(),
+ listenerTransport.getName().getLocalPart()));
msgctx.setOperationContext(axisop.findOperationContext(msgctx, serviceContext));
msgctx.setServiceContext(serviceContext);
engine.send(msgctx);
} else {
- serviceContext.getEngineContext().getThreadPool().addWorker(
- new NonBlockingInvocationWorker(callback, axisop, msgctx));
+ serviceContext.getEngineContext().getThreadPool().addWorker(new NonBlockingInvocationWorker(callback, axisop, msgctx));
}
} catch (OMException e) {
@@ -205,14 +200,14 @@
}
/**
- * @param to
- */
+ * @param to
+ */
public void setTo(EndpointReference to) {
this.to = to;
}
/**
- * Set transport information to the the Call, for find how the each parameter acts see the commant at the instance
+ * Set transport information to the the Call, for find how the each parameter acts see the commant at the instance
* variables. The senarios supoorted are as follows.
* [senderTransport, listenerTransport, useSeparateListener]
* http, http, true
@@ -220,30 +215,29 @@
* http,smtp,true
* smtp,http,true
* smtp,smtp,true
- *
+ *
* @param senderTransport
* @param listenerTransport
* @param useSeparateListener
* @throws AxisFault
*/
- public void setTransportInfo(
- String senderTransport,
- String listenerTransport,
- boolean useSeparateListener)
- throws AxisFault {
+ public void setTransportInfo(String senderTransport,
+ String listenerTransport,
+ boolean useSeparateListener)
+ throws AxisFault {
if (!useSeparateListener) {
boolean isTransportsEqual = senderTransport.equals(listenerTransport);
boolean isATwoWaytransport = Constants.TRANSPORT_HTTP.equals(senderTransport)
- || Constants.TRANSPORT_TCP.equals(senderTransport)
- || Constants.TRANSPORT_COMMONS_HTTP.equals(senderTransport);
- boolean isCommonsAndHTTP = Constants.TRANSPORT_COMMONS_HTTP.equals(senderTransport)
- && Constants.TRANSPORT_HTTP.equals(listenerTransport);
- if(!isCommonsAndHTTP && (!isTransportsEqual || !isATwoWaytransport)){
+ || Constants.TRANSPORT_TCP.equals(senderTransport)
+ || Constants.TRANSPORT_COMMONS_HTTP.equals(senderTransport);
+ boolean isCommonsAndHTTP = Constants.TRANSPORT_COMMONS_HTTP.equals(senderTransport)
+ && Constants.TRANSPORT_HTTP.equals(listenerTransport);
+ if (!isCommonsAndHTTP && (!isTransportsEqual || !isATwoWaytransport)) {
throw new AxisFault("useSeparateListener = false is only supports by the htpp/tcp and tcp commons transport set as the sender and receiver");
}
- }else{
+ } else {
this.useSeparateListener = useSeparateListener;
}
@@ -261,9 +255,9 @@
if (useSeparateListener == true) {
if (!serviceContext
- .getEngineContext()
- .getAxisConfiguration()
- .isEngaged(new QName(Constants.MODULE_ADDRESSING))) {
+ .getEngineContext()
+ .getAxisConfiguration()
+ .isEngaged(new QName(Constants.MODULE_ADDRESSING))) {
throw new AxisFault("to do two Transport Channels the Addressing Modules must be engeged");
}
ListenerManager.makeSureStarted(listenerTransport, serviceContext.getEngineContext());
@@ -276,8 +270,7 @@
}
if (listenerTransport == null) {
listenerTransport =
- serviceContext.getEngineContext().getAxisConfiguration().getTransportIn(
- senderTransport.getName());
+ serviceContext.getEngineContext().getAxisConfiguration().getTransportIn(senderTransport.getName());
}
if (msgctx.getTransportIn() == null) {
@@ -292,9 +285,11 @@
public class SyncCallBack extends Callback {
private SOAPEnvelope envelope;
private Exception error;
+
public void onComplete(AsyncResult result) {
this.envelope = result.getResponseEnvelope();
}
+
public void reportError(Exception e) {
error = e;
}
@@ -318,10 +313,9 @@
private OperationDescription axisop;
private MessageContext msgctx;
- public NonBlockingInvocationWorker(
- Callback callback,
- OperationDescription axisop,
- MessageContext msgctx) {
+ public NonBlockingInvocationWorker(Callback callback,
+ OperationDescription axisop,
+ MessageContext msgctx) {
this.callback = callback;
this.axisop = axisop;
this.msgctx = msgctx;
@@ -329,11 +323,9 @@
public void doWork() {
try {
- msgctx.setOperationContext(
- OperationContextFactory.createMEPContext(
- WSDLConstants.MEP_CONSTANT_IN_OUT,
- axisop,
- serviceContext));
+ msgctx.setOperationContext(OperationContextFactory.createMEPContext(WSDLConstants.MEP_CONSTANT_IN_OUT,
+ axisop,
+ serviceContext));
msgctx.setServiceContext(serviceContext);
MessageContext response = TwoChannelBasedSender.send(msgctx, listenerTransport);
SOAPEnvelope resenvelope = response.getEnvelope();
@@ -345,5 +337,5 @@
}
}
}
-
+
}
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/ListenerManager.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/ListenerManager.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/ListenerManager.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/ListenerManager.java Mon Jul 11 08:49:30 2005
@@ -34,10 +34,9 @@
public static HashMap listeners = new HashMap();
public static ConfigurationContext configurationContext;
- public static final void makeSureStarted(
- String transport,
- ConfigurationContext configurationContext)
- throws AxisFault {
+ public static final void makeSureStarted(String transport,
+ ConfigurationContext configurationContext)
+ throws AxisFault {
if (ListenerManager.configurationContext != null && configurationContext != ListenerManager.configurationContext) {
throw new AxisFault("Only One ConfigurationContext Instance we support at the Client Side");
}
@@ -46,12 +45,12 @@
TransportListnerState tsState = (TransportListnerState) listeners.get(transport);
if (tsState == null) {
TransportInDescription tranportIn =
- configurationContext.getAxisConfiguration().getTransportIn(new QName(transport));
+ configurationContext.getAxisConfiguration().getTransportIn(new QName(transport));
TransportListener listener = tranportIn.getReciever();
// listener.init(configurationContext, tranportIn);
listener.start();
tsState = new TransportListnerState(listener);
- listeners.put(transport,tsState);
+ listeners.put(transport, tsState);
}
tsState.waitingCalls++;
}
@@ -67,14 +66,13 @@
}
public static EndpointReference replyToEPR(String serviceName, String transport)
- throws AxisFault {
+ throws AxisFault {
TransportListnerState tsState = (TransportListnerState) listeners.get(transport);
if (tsState != null) {
return tsState.listener.replyToEPR(serviceName);
} else {
- throw new AxisFault(
- "Calling method before starting the with makeSureStarted(..) Listener transport = "
- + transport);
+ throw new AxisFault("Calling method before starting the with makeSureStarted(..) Listener transport = "
+ + transport);
}
@@ -89,11 +87,12 @@
public TransportListnerState(TransportListener listener) {
this.listener = listener;
}
+
public int waitingCalls = 0;
public TransportListener listener;
}
- public static ServerSocket openSocket(int port) throws AxisFault {
+ public static ServerSocket openSocket(int port) throws AxisFault {
for (int i = 0; i < 5; i++) {
try {
return new ServerSocket(port + i);
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/MEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/MEPClient.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/MEPClient.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/MEPClient.java Mon Jul 11 08:49:30 2005
@@ -40,12 +40,12 @@
protected final String mep;
protected String soapVersionURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
protected String soapAction = "";
- protected boolean doREST = false;
+ protected boolean doREST = false;
protected String wsaAction;
public void setDoREST(boolean b) {
- doREST = b;
- }
+ doREST = b;
+ }
public String getSoapAction() {
@@ -57,23 +57,23 @@
this.mep = mep;
}
- protected void verifyInvocation(OperationDescription axisop,MessageContext msgCtx) throws AxisFault {
+ protected void verifyInvocation(OperationDescription axisop, MessageContext msgCtx) throws AxisFault {
if (axisop == null) {
throw new AxisFault("OperationDescription can not be null");
}
if (mep.equals(axisop.getMessageExchangePattern())) {
throw new AxisFault("This mepClient supports only "
- + mep
- + " And the Axis Operations suppiled supports "
- + axisop.getMessageExchangePattern());
+ + mep
+ + " And the Axis Operations suppiled supports "
+ + axisop.getMessageExchangePattern());
}
if (serviceContext.getServiceConfig().getOperation(axisop.getName()) == null) {
serviceContext.getServiceConfig().addOperation(axisop);
}
msgCtx.setDoingREST(doREST);
- if(wsaAction != null){
+ if (wsaAction != null) {
msgCtx.setWSAAction(wsaAction);
}
}
@@ -106,14 +106,14 @@
}
- public SOAPEnvelope createDefaultSOAPEnvelope() throws AxisFault{
+ public SOAPEnvelope createDefaultSOAPEnvelope() throws AxisFault {
SOAPFactory fac = null;
if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapVersionURI)) {
fac = OMAbstractFactory.getSOAP12Factory();
} else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapVersionURI)) {
fac = OMAbstractFactory.getSOAP11Factory();
} else {
- throw new AxisFault("Invalid SOAP URI. Axis2 only supports SOAP 1.1 and 1.2");
+ throw new AxisFault("Invalid SOAP URI. Axis2 only supports SOAP 1.1 and 1.2");
}
return fac.getDefaultEnvelope();
}
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/MessageSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/MessageSender.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/MessageSender.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/MessageSender.java Mon Jul 11 08:49:30 2005
@@ -29,9 +29,9 @@
/**
* @author hemapani
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
+ * <p/>
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
*/
public class MessageSender extends InOnlyMEPClient {
public MessageSender(ServiceContext service) {
@@ -41,9 +41,10 @@
public MessageSender() throws AxisFault {
super(assumeServiceContext());
}
+
public void send(String opName, OMElement toSend) throws AxisFault {
OperationDescription axisOp = serviceContext.getServiceConfig().getOperation(opName);
- if(axisOp == null){
+ if (axisOp == null) {
axisOp = new OperationDescription(new QName(opName));
serviceContext.getServiceConfig().addOperation(axisOp);
}
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/StreamWrapper.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/StreamWrapper.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/StreamWrapper.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/StreamWrapper.java Mon Jul 11 08:49:30 2005
@@ -23,7 +23,8 @@
*
*
*/
-public class StreamWrapper implements XMLStreamReader{
+
+public class StreamWrapper implements XMLStreamReader {
private XMLStreamReader realReader = null;
private static final int STATE_SWITCHED = 0;
@@ -34,16 +35,16 @@
private int prevState = state;
public StreamWrapper(XMLStreamReader realReader) {
- if (realReader==null){
+ if (realReader == null) {
throw new UnsupportedOperationException("Reader cannot be null");
}
this.realReader = realReader;
}
public Object getProperty(String s) throws IllegalArgumentException {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getProperty(s);
- }else{
+ } else {
throw new IllegalArgumentException();
}
}
@@ -52,364 +53,364 @@
prevState = state;
- if (state==STATE_SWITCHED){
+ if (state == STATE_SWITCHED) {
return realReader.next();
- }else if (state==STATE_INIT){
- if (realReader.getEventType()==START_DOCUMENT){
+ } else if (state == STATE_INIT) {
+ if (realReader.getEventType() == START_DOCUMENT) {
state = STATE_SWITCHED;
- return realReader.getEventType();
- }else{
+ return realReader.getEventType();
+ } else {
state = STATE_SWITHC_AT_NEXT;
return START_DOCUMENT;
}
- }else if (state==STATE_SWITHC_AT_NEXT) {
+ } else if (state == STATE_SWITHC_AT_NEXT) {
state = STATE_SWITCHED;
return realReader.getEventType();
- }else{
+ } else {
throw new UnsupportedOperationException();
}
}
public void require(int i, String s, String s1) throws XMLStreamException {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
realReader.require(i, s, s1);
}
}
public String getElementText() throws XMLStreamException {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getElementText();
- }else{
+ } else {
throw new XMLStreamException();
}
}
public int nextTag() throws XMLStreamException {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.nextTag();
- }else{
+ } else {
throw new XMLStreamException();
}
}
public boolean hasNext() throws XMLStreamException {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.hasNext();
- }else{
- return true;
+ } else {
+ return true;
}
}
public void close() throws XMLStreamException {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
realReader.close();
- }else{
+ } else {
throw new XMLStreamException();
}
}
public String getNamespaceURI(String s) {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getNamespaceURI(s);
- }else{
+ } else {
return null;
}
}
public boolean isStartElement() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.isStartElement();
- }else{
+ } else {
return false;
}
}
public boolean isEndElement() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.isEndElement();
- }else{
+ } else {
return false;
}
}
public boolean isCharacters() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.isCharacters();
- }else{
+ } else {
return false;
}
}
public boolean isWhiteSpace() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.isWhiteSpace();
- }else{
+ } else {
return false;
}
}
public String getAttributeValue(String s, String s1) {
- if(prevState!=STATE_INIT){
- return realReader.getAttributeValue(s,s1);
- }else{
+ if (prevState != STATE_INIT) {
+ return realReader.getAttributeValue(s, s1);
+ } else {
return null;
}
}
public int getAttributeCount() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getAttributeCount();
- }else{
+ } else {
return 0;
}
}
public QName getAttributeName(int i) {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getAttributeName(i);
- }else{
+ } else {
return null;
}
}
public String getAttributeNamespace(int i) {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getAttributeNamespace(i);
- }else{
+ } else {
return null;
}
}
public String getAttributeLocalName(int i) {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getAttributeLocalName(i);
- }else{
+ } else {
return null;
}
}
public String getAttributePrefix(int i) {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getAttributePrefix(i);
- }else{
+ } else {
return null;
}
}
public String getAttributeType(int i) {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getAttributeType(i);
- }else{
+ } else {
return null;
}
}
public String getAttributeValue(int i) {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getAttributeValue(i);
- }else{
+ } else {
return null;
}
}
public boolean isAttributeSpecified(int i) {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.isAttributeSpecified(i);
- }else{
+ } else {
return false;
}
}
public int getNamespaceCount() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getNamespaceCount();
- }else{
+ } else {
return 0;
}
}
public String getNamespacePrefix(int i) {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getNamespacePrefix(i);
- }else{
+ } else {
return null;
}
}
public String getNamespaceURI(int i) {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getNamespaceURI(i);
- }else{
+ } else {
return null;
}
}
public NamespaceContext getNamespaceContext() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getNamespaceContext();
- }else{
+ } else {
return null;
}
}
public int getEventType() {
- if(prevState==STATE_INIT){
+ if (prevState == STATE_INIT) {
return START_DOCUMENT;
- }else{
+ } else {
return realReader.getEventType();
}
}
public String getText() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getText();
- }else{
+ } else {
return null;
}
}
public char[] getTextCharacters() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getTextCharacters();
- }else{
- return new char[0] ;
+ } else {
+ return new char[0];
}
}
public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException {
- if(prevState!=STATE_INIT){
- return realReader.getTextCharacters(i,chars,i1,i2);
- }else{
- return 0 ;
+ if (prevState != STATE_INIT) {
+ return realReader.getTextCharacters(i, chars, i1, i2);
+ } else {
+ return 0;
}
}
public int getTextStart() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getTextStart();
- }else{
- return 0 ;
+ } else {
+ return 0;
}
}
public int getTextLength() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getTextStart();
- }else{
- return 0 ;
+ } else {
+ return 0;
}
}
public String getEncoding() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getEncoding();
- }else{
- return null ;
+ } else {
+ return null;
}
}
public boolean hasText() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.hasText();
- }else{
- return false ;
+ } else {
+ return false;
}
}
public Location getLocation() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getLocation();
- }else{
- return null ;
+ } else {
+ return null;
}
}
public QName getName() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getName();
- }else{
- return null ;
+ } else {
+ return null;
}
}
public String getLocalName() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getLocalName();
- }else{
- return null ;
+ } else {
+ return null;
}
}
public boolean hasName() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.hasName();
- }else{
- return false ;
+ } else {
+ return false;
}
}
public String getNamespaceURI() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getNamespaceURI();
- }else{
- return null ;
+ } else {
+ return null;
}
}
public String getPrefix() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getPrefix();
- }else{
- return null ;
+ } else {
+ return null;
}
}
public String getVersion() {
- if(prevState!=STATE_INIT){
- return realReader.getVersion();
- }else{
- return null ;
+ if (prevState != STATE_INIT) {
+ return realReader.getVersion();
+ } else {
+ return null;
}
}
public boolean isStandalone() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.isStandalone();
- }else{
- return false ;
+ } else {
+ return false;
}
}
public boolean standaloneSet() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.standaloneSet();
- }else{
- return false ;
+ } else {
+ return false;
}
}
public String getCharacterEncodingScheme() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getCharacterEncodingScheme();
- }else{
- return null ;
+ } else {
+ return null;
}
}
public String getPITarget() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getPITarget();
- }else{
- return null ;
+ } else {
+ return null;
}
}
public String getPIData() {
- if(prevState!=STATE_INIT){
+ if (prevState != STATE_INIT) {
return realReader.getPIData();
- }else{
- return null ;
+ } else {
+ return null;
}
}
}
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/Stub.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/Stub.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/Stub.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/Stub.java Mon Jul 11 08:49:30 2005
@@ -38,18 +38,15 @@
import javax.xml.stream.XMLStreamReader;
-
/**
* @author chathura@opensource.lk
- *
*/
public abstract class Stub {
protected ConfigurationContext _configurationContext;
protected static ServiceDescription _service;
protected ServiceContext _serviceContext;
- protected EndpointReference toEPR ;
-
+ protected EndpointReference toEPR;
/**
@@ -61,7 +58,7 @@
protected String _currentSessionId = null;
- protected Stub()throws DeploymentException, AxisFault{
+ protected Stub() throws DeploymentException, AxisFault {
}
@@ -69,8 +66,8 @@
//
// public abstract Object _getSessionInfo(Object key) throws Exception ;
- public void _setSessionInfo(String key, Object value)throws java.lang.Exception{
- if(!_maintainSession){
+ public void _setSessionInfo(String key, Object value) throws java.lang.Exception {
+ if (!_maintainSession) {
//TODO Comeup with a Exception
throw new java.lang.Exception("Client is running the session OFF mode: Start session before saving to a session ");
}
@@ -78,31 +75,31 @@
}
- public Object _getSessionInfo(String key) throws java.lang.Exception{
- if(!_maintainSession){
+ public Object _getSessionInfo(String key) throws java.lang.Exception {
+ if (!_maintainSession) {
//TODO Comeup with a Exception
throw new java.lang.Exception("Client is running the session OFF mode: Start session before saving to a session ");
}
return _configurationContext.getServiceContext(_currentSessionId).getProperty(key);
}
- public void _startSession(){
+ public void _startSession() {
_maintainSession = true;
- _currentSessionId = getID() ;
+ _currentSessionId = getID();
}
- public void _endSession(){
+ public void _endSession() {
_maintainSession = false;
}
- protected String _getServiceContextID(){
- if(_maintainSession)
+ protected String _getServiceContextID() {
+ if (_maintainSession)
return _currentSessionId;
else
return getID();
}
- private String getID(){
+ private String getID() {
//TODO Get the UUID generator to generate values
return Long.toString(System.currentTimeMillis());
}
@@ -113,21 +110,21 @@
return env;
}
- protected void setValueRPC(SOAPEnvelope env,String methodNamespaceURI,String methodName,String[] paramNames,Object[] values){
+ protected void setValueRPC(SOAPEnvelope env, String methodNamespaceURI, String methodName, String[] paramNames, Object[] values) {
SOAPBody body = env.getBody();
OMFactory fac = this.getFactory();
- OMNamespace methodNamespace = fac.createOMNamespace(methodNamespaceURI,"ns1");
- OMElement elt = fac.createOMElement(methodName,methodNamespace);
- if (paramNames!=null){
+ OMNamespace methodNamespace = fac.createOMNamespace(methodNamespaceURI, "ns1");
+ OMElement elt = fac.createOMElement(methodName, methodNamespace);
+ if (paramNames != null) {
//find the relevant object here, convert it and add it to the elt
for (int i = 0; i < paramNames.length; i++) {
String paramName = paramNames[i];
- Object value = values[i];
+ Object value = values[i];
elt.addChild(StubSupporter.createRPCMappedElement(paramName,
- fac.createOMNamespace("",null),//empty namespace
- value,
- fac));
+ fac.createOMNamespace("", null), //empty namespace
+ value,
+ fac));
}
}
body.addChild(elt);
@@ -135,26 +132,26 @@
protected OMElement getElementFromReader(XMLStreamReader reader) {
- StAXOMBuilder builder = OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getOMFactory(),reader) ;
+ StAXOMBuilder builder = OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getOMFactory(), reader);
return builder.getDocumentElement();
}
- protected void setValueDoc(SOAPEnvelope env,OMElement value){
- if (value!=null){
+ protected void setValueDoc(SOAPEnvelope env, OMElement value) {
+ if (value != null) {
SOAPBody body = env.getBody();
body.addChild(value);
}
}
- protected OMElement getElement(SOAPEnvelope env,String type){
+ protected OMElement getElement(SOAPEnvelope env, String type) {
SOAPBody body = env.getBody();
OMElement element = body.getFirstElement();
- if (WSDLService.STYLE_RPC.equals(type)){
+ if (WSDLService.STYLE_RPC.equals(type)) {
return element.getFirstElement(); //todo this needs to be fixed
- }else if (WSDLService.STYLE_DOC.equals(type)){
+ } else if (WSDLService.STYLE_DOC.equals(type)) {
return element;
- }else {
+ } else {
throw new UnsupportedOperationException("Unsupported type");
}
@@ -181,7 +178,7 @@
}
- private SOAPFactory getFactory(){
+ private SOAPFactory getFactory() {
return OMAbstractFactory.getSOAP11Factory();
}
}
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/StubSupporter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/StubSupporter.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/StubSupporter.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/StubSupporter.java Mon Jul 11 08:49:30 2005
@@ -22,47 +22,48 @@
* A utility class for the use of the stub
* Not visible outside
*/
+
class StubSupporter {
- public static OMElement createRPCMappedElement(String elementName,OMNamespace ns,Object value, OMFactory fac){
- OMElement returnElement = fac.createOMElement(elementName,ns);
- Class inputParamClass = value.getClass();
-
- if (inputParamClass.equals(String.class)){
- returnElement.addChild(fac.createText(returnElement,value.toString()));
- }else if (inputParamClass.equals(Integer.class)){
- returnElement.addChild(fac.createText(returnElement,String.valueOf(((Integer)value).intValue())));
- }else if (inputParamClass.equals(Float.class)){
- returnElement.addChild(fac.createText(returnElement,String.valueOf(((Float)value).floatValue())));
- }else if (inputParamClass.equals(Double.class)){
- returnElement.addChild(fac.createText(returnElement,String.valueOf(((Double)value).doubleValue())));
- //todo this seems to be a long list... need to complete this
- }else if (inputParamClass.equals(OMElement.class)){
- returnElement.addChild((OMElement)value);
- }else{
- returnElement.addChild(fac.createText(returnElement,value.toString()));
- }
+ public static OMElement createRPCMappedElement(String elementName, OMNamespace ns, Object value, OMFactory fac) {
+ OMElement returnElement = fac.createOMElement(elementName, ns);
+ Class inputParamClass = value.getClass();
+
+ if (inputParamClass.equals(String.class)) {
+ returnElement.addChild(fac.createText(returnElement, value.toString()));
+ } else if (inputParamClass.equals(Integer.class)) {
+ returnElement.addChild(fac.createText(returnElement, String.valueOf(((Integer) value).intValue())));
+ } else if (inputParamClass.equals(Float.class)) {
+ returnElement.addChild(fac.createText(returnElement, String.valueOf(((Float) value).floatValue())));
+ } else if (inputParamClass.equals(Double.class)) {
+ returnElement.addChild(fac.createText(returnElement, String.valueOf(((Double) value).doubleValue())));
+ //todo this seems to be a long list... need to complete this
+ } else if (inputParamClass.equals(OMElement.class)) {
+ returnElement.addChild((OMElement) value);
+ } else {
+ returnElement.addChild(fac.createText(returnElement, value.toString()));
+ }
return returnElement;
}
- public static Object getRPCMappedElementValue(OMElement elt, Class outputTypeClass){
- Object outputObj = null;
- if (outputTypeClass.equals(String.class)){
- outputObj = elt.getText();
- }else if (outputTypeClass.equals(Integer.class)){
+ public static Object getRPCMappedElementValue(OMElement elt, Class outputTypeClass) {
+ Object outputObj = null;
+ if (outputTypeClass.equals(String.class)) {
+ outputObj = elt.getText();
+ } else if (outputTypeClass.equals(Integer.class)) {
outputObj = new Integer(elt.getText());
- }else if (outputTypeClass.equals(Float.class)){
+ } else if (outputTypeClass.equals(Float.class)) {
outputObj = new Float(elt.getText());
- }else if (outputTypeClass.equals(Double.class)){
+ } else if (outputTypeClass.equals(Double.class)) {
outputObj = new Double(elt.getText());
- //todo this seems to be a long list... need to complete this
+ //todo this seems to be a long list... need to complete this
- }else if (outputTypeClass.equals(OMElement.class)){
- outputObj = elt;
- }else{
- outputObj = elt.toString();
- }
+ } else if (outputTypeClass.equals(OMElement.class)) {
+ outputObj = elt;
+ } else {
+ outputObj = elt.toString();
+ }
return outputObj;
}
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/TwoChannelBasedSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/TwoChannelBasedSender.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/TwoChannelBasedSender.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/TwoChannelBasedSender.java Mon Jul 11 08:49:30 2005
@@ -24,28 +24,27 @@
public class TwoChannelBasedSender {
- public static MessageContext send(MessageContext msgctx,TransportInDescription transportIn) throws AxisFault{
-
+ public static MessageContext send(MessageContext msgctx, TransportInDescription transportIn) throws AxisFault {
+
AxisEngine engine = new AxisEngine(msgctx.getSystemContext());
-
+
engine.send(msgctx);
MessageContext response =
- new MessageContext(msgctx.getSystemContext(),
- msgctx.getSessionContext(),
- msgctx.getTransportIn(),
- msgctx.getTransportOut());
- response.setProperty(
- MessageContext.TRANSPORT_IN,
- msgctx.getProperty(MessageContext.TRANSPORT_IN));
+ new MessageContext(msgctx.getSystemContext(),
+ msgctx.getSessionContext(),
+ msgctx.getTransportIn(),
+ msgctx.getTransportOut());
+ response.setProperty(MessageContext.TRANSPORT_IN,
+ msgctx.getProperty(MessageContext.TRANSPORT_IN));
response.setServerSide(false);
response.setOperationContext(msgctx.getOperationContext());
response.setServiceContext(msgctx.getServiceContext());
//If request is REST we assume the response is REST, so set the variable
response.setDoingREST(msgctx.isDoingREST());
-
+
SOAPEnvelope resenvelope = TransportUtils.createSOAPMessage(response);
if (resenvelope != null) {
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/AbstractContext.java Mon Jul 11 08:49:30 2005
@@ -82,14 +82,15 @@
if (persistent) {
obj = persistentMap.get(key);
}
- if(obj == null){
- obj = nonPersistentMap.get(key);
+ if (obj == null) {
+ obj = nonPersistentMap.get(key);
}
if (obj == null && parent != null) {
obj = parent.getProperty(key, persistent);
}
return obj;
}
+
/**
* @param context
*/
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java Mon Jul 11 08:49:30 2005
@@ -25,12 +25,11 @@
import org.apache.axis2.util.threadpool.ThreadPool;
import javax.xml.namespace.QName;
-
import java.io.File;
import java.util.HashMap;
import java.util.Map;
-public class ConfigurationContext extends AbstractContext{
+public class ConfigurationContext extends AbstractContext {
private AxisConfiguration axisConfiguration;
private AxisStorage storage;
@@ -39,7 +38,7 @@
private Map moduleContextMap;
private ThreadPool threadPool;
private File rootDir;
-
+
/**
* Map containing <code>MessageID</code> to
@@ -86,7 +85,7 @@
axisConfiguration = configuration;
}
- public synchronized void registerOperationContext(String messageID, OperationContext mepContext) {
+ public synchronized void registerOperationContext(String messageID, OperationContext mepContext) {
this.operationContextMap.put(messageID, mepContext);
}
@@ -116,11 +115,11 @@
public ServiceContext createServiceContext(QName serviceName) throws AxisFault {
ServiceDescription service = axisConfiguration.getService(serviceName);
- if(service != null){
+ if (service != null) {
ServiceContext serviceContext = new ServiceContext(service, this);
return serviceContext;
- }else{
- throw new AxisFault("Service not found service name = "+serviceName );
+ } else {
+ throw new AxisFault("Service not found service name = " + serviceName);
}
}
@@ -128,18 +127,20 @@
* @return
*/
public ThreadPool getThreadPool() {
- if(threadPool == null){
+ if (threadPool == null) {
threadPool = new ThreadPool();
}
return threadPool;
}
- public File getRealPath(String path){
- if(rootDir == null){
+
+ public File getRealPath(String path) {
+ if (rootDir == null) {
return new File(path);
- }else{
- return new File(rootDir,path);
+ } else {
+ return new File(rootDir, path);
}
}
+
/**
* @param file
*/
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContextFactory.java Mon Jul 11 08:49:30 2005
@@ -30,11 +30,11 @@
public class ConfigurationContextFactory {
public ConfigurationContext buildConfigurationContext(String RepositaryName)
- throws DeploymentException {
+ throws DeploymentException {
ConfigurationContext configurationContext = null;
try {
DeploymentEngine deploymentEngine =
- new DeploymentEngine(RepositaryName);
+ new DeploymentEngine(RepositaryName);
AxisConfiguration configuration = deploymentEngine.load();
PhaseResolver phaseResolver = new PhaseResolver(configuration);
configurationContext = new ConfigurationContext(configuration);
@@ -47,11 +47,11 @@
}
public ConfigurationContext buildClientConfigurationContext(String axis2home)
- throws DeploymentException {
+ throws DeploymentException {
ConfigurationContext engineContext = null;
try {
AxisConfiguration configuration =
- new DeploymentEngine().loadClient(axis2home);
+ new DeploymentEngine().loadClient(axis2home);
PhaseResolver phaseResolver = new PhaseResolver(configuration);
engineContext = new ConfigurationContext(configuration);
phaseResolver.buildTranspotsChains();
@@ -72,15 +72,15 @@
*/
private void initModules(ConfigurationContext context)
- throws DeploymentException {
+ throws DeploymentException {
try {
HashMap modules =
- ((AxisConfigurationImpl) context.getAxisConfiguration())
+ ((AxisConfigurationImpl) context.getAxisConfiguration())
.getModules();
Collection col = modules.values();
for (Iterator iterator = col.iterator(); iterator.hasNext();) {
ModuleDescription axismodule =
- (ModuleDescription) iterator.next();
+ (ModuleDescription) iterator.next();
Module module = axismodule.getModule();
if (module != null) {
module.init(context.getAxisConfiguration());
@@ -91,19 +91,18 @@
}
}
- public static void createChains(
- ServiceDescription service,
- AxisConfiguration configurationContextVal,
- ArrayList modules)
- throws PhaseException {
+ public static void createChains(ServiceDescription service,
+ AxisConfiguration configurationContextVal,
+ ArrayList modules)
+ throws PhaseException {
try {
PhaseResolver reolve =
- new PhaseResolver(configurationContextVal, service);
+ new PhaseResolver(configurationContextVal, service);
reolve.buildchains();
for (int i = 0; i < modules.size(); i++) {
QName qName = (QName) modules.get(i);
ModuleDescription moduledecs =
- configurationContextVal.getModule(qName);
+ configurationContextVal.getModule(qName);
reolve.engageModuleToService(service, moduledecs);
}
} catch (PhaseException e) {
@@ -114,7 +113,7 @@
}
public void initTransports(ConfigurationContext configContext)
- throws AxisFault {
+ throws AxisFault {
AxisConfiguration axisConf = configContext.getAxisConfiguration();
//Initzialize Transport Ins
@@ -122,7 +121,7 @@
Iterator values = transportIns.values().iterator();
while (values.hasNext()) {
TransportInDescription transportIn =
- (TransportInDescription) values.next();
+ (TransportInDescription) values.next();
TransportListener listener = transportIn.getReciever();
if (listener != null) {
listener.init(configContext, transportIn);
@@ -133,7 +132,7 @@
values = transportOuts.values().iterator();
while (values.hasNext()) {
TransportOutDescription transportOut =
- (TransportOutDescription) values.next();
+ (TransportOutDescription) values.next();
TransportSender sender = transportOut.getSender();
if (sender != null) {
sender.init(configContext, transportOut);
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java Mon Jul 11 08:49:30 2005
@@ -41,8 +41,7 @@
* Field TRANSPORT_READER
*/
public static final String TRANSPORT_IN = "TRANSPORT_IN";
-
-
+
/**
* Field TRANSPORT_SUCCEED
@@ -115,21 +114,22 @@
public boolean outPutWritten = false;
private String serviceInstanceID;
-
+
private String pausedPhaseName;
-
+
private QName pausedHandlerName;
-
+
private String soapAction;
-
-
+
+
//Are we doing MTOM now?
private boolean doingMTOM = false;
//Are we doing REST now?
private boolean doingREST = false;
-
+
/**
* Conveniance Method, but before call engine.send() or engine.receive() one must send transport in/out
+ *
* @param engineContext
* @throws AxisFault
*/
@@ -138,11 +138,10 @@
this(engineContext, null, null, null);
}
- public MessageContext(
- ConfigurationContext engineContext,
- TransportInDescription transportIn,
- TransportOutDescription transportOut)
- throws AxisFault {
+ public MessageContext(ConfigurationContext engineContext,
+ TransportInDescription transportIn,
+ TransportOutDescription transportOut)
+ throws AxisFault {
this(engineContext, null, transportIn, transportOut);
}
@@ -154,12 +153,11 @@
* @throws AxisFault
*/
- public MessageContext(
- ConfigurationContext engineContext,
- SessionContext sessionContext,
- TransportInDescription transportIn,
- TransportOutDescription transportOut)
- throws AxisFault {
+ public MessageContext(ConfigurationContext engineContext,
+ SessionContext sessionContext,
+ TransportInDescription transportIn,
+ TransportOutDescription transportOut)
+ throws AxisFault {
super(null);
if (sessionContext == null) {
@@ -389,10 +387,10 @@
paused = true;
this.pausedHandlerName = handlerName;
}
-
+
public void setPausedFalse() {
- paused = false;
- }
+ paused = false;
+ }
/**
* @return
@@ -536,6 +534,7 @@
}
return obj;
}
+
/**
* @return
*/
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/OperationContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/OperationContext.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/OperationContext.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/OperationContext.java Mon Jul 11 08:49:30 2005
@@ -151,11 +151,11 @@
return outMessageContext;
} else {
throw new AxisFault("Unrecognized message label: '" + messageLabel
- + "'");
+ + "'");
}
}
- /**
+ /**
* Checks to see if the MEP is complete. i.e. whether all the messages that
* are associated with the MEP has arrived and MEP is complete.
*
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/OperationContextFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/OperationContextFactory.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/OperationContextFactory.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/context/OperationContextFactory.java Mon Jul 11 08:49:30 2005
@@ -37,7 +37,7 @@
} else {
throw new AxisFault("Cannot handle the MEP " + mepURI
- + " for the current invocation of Operation ");
+ + " for the current invocation of Operation ");
}
}
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentClassLoader.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentClassLoader.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentClassLoader.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentClassLoader.java Mon Jul 11 08:49:30 2005
@@ -1,11 +1,11 @@
package org.apache.axis2.deployment;
+import java.io.*;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
-import java.util.zip.ZipInputStream;
import java.util.zip.ZipEntry;
-import java.io.*;
+import java.util.zip.ZipInputStream;
/*
* Copyright 2004,2005 The Apache Software Foundation.
@@ -30,7 +30,7 @@
* Date: Jul 11, 2005
* Time: 1:07:03 PM
*/
-public class DeploymentClassLoader extends URLClassLoader{
+public class DeploymentClassLoader extends URLClassLoader {
//urls which gives to create the classLoader
private URL[] urls;
@@ -43,8 +43,9 @@
* DeploymentClassLoader is exetend form URLClassLoader , and the constructor
* has not overide the super constroctor , but has done some stuff to find out
* jar fils inside /lib director
- * @param urls <code>URL</code>
- * @param parent parent classloader <code>ClassLoader</code>
+ *
+ * @param urls <code>URL</code>
+ * @param parent parent classloader <code>ClassLoader</code>
*/
public DeploymentClassLoader(URL[] urls, ClassLoader parent) {
super(urls, parent);
@@ -57,7 +58,7 @@
* This just search for jar files inside /lib dirctory and if there are any then those
* will be added to the arraylit (only the name of the jar file)
*/
- private void findLibJars(){
+ private void findLibJars() {
/**
* though the URL array can contains one or more urls , I have only consider the
* first one , that is this classLoader is only for Axis2 stuff and the classloader
@@ -81,31 +82,28 @@
}
}
zin.close();
- }catch(Exception e){
- throw new RuntimeException(e) ;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
}
}
/**
- *
* @param name <code>String</code> Name of the file to be loaded
- * @return <code>Class</code> return a class object if it found else
- * will return null or classNotfoun exeption
- *
- * The method has ovride in the following way
- * 1. called the super class and check to see wether the class is there
- * if the class is found then return that , else if super returns ClassNotfoundExeption
- * 2. Check wether the entry corresponding to the class name exsit in one of jar files
- * in /lib director
- * 3. If it is there get the byte array out of that and creat a Class object out of that
- * by calling "defineClass()" , if it sucssed then return that else
- * 4. Throw classNotfound exeption
- *
+ * @return <code>Class</code> return a class object if it found else
+ * will return null or classNotfoun exeption
+ * <p/>
+ * The method has ovride in the following way
+ * 1. called the super class and check to see wether the class is there
+ * if the class is found then return that , else if super returns ClassNotfoundExeption
+ * 2. Check wether the entry corresponding to the class name exsit in one of jar files
+ * in /lib director
+ * 3. If it is there get the byte array out of that and creat a Class object out of that
+ * by calling "defineClass()" , if it sucssed then return that else
+ * 4. Throw classNotfound exeption
* @throws ClassNotFoundException
*/
protected Class findClass(final String name)
- throws ClassNotFoundException
- {
+ throws ClassNotFoundException {
Class cla = null;
try {
boolean foundClass = false;
@@ -116,17 +114,17 @@
} catch (ClassNotFoundException e) {
foundClass = false;
}
- if(!foundClass){
- byte raw[] = getBytes( name );
- cla = defineClass( name, raw, 0, raw.length );
+ if (!foundClass) {
+ byte raw[] = getBytes(name);
+ cla = defineClass(name, raw, 0, raw.length);
foundClass = true;
return cla;
}
- if(!foundClass){
+ if (!foundClass) {
throw new ClassNotFoundException("Class Not found : " + name);
}
- }catch (Exception e){
+ } catch (Exception e) {
}
return null;
@@ -137,13 +135,14 @@
* that and check to see wether there is any entry eith given name if it found then
* Creat ByteArrayOutPutStream and get the class bytes to that .
* after goning throgh each and evry jar file if there is no entry with given name
- * will throug a ClassNotFound execption
- * @param filename <code>String</code> Name of the file to be loaded (Class Name)
+ * will throug a ClassNotFound execption
+ *
+ * @param filename <code>String</code> Name of the file to be loaded (Class Name)
* @return bytt[]
- * @throws java.io.IOException <code>Exception</code>
+ * @throws java.io.IOException <code>Exception</code>
*/
- private byte[] getBytes( String filename ) throws Exception {
- String completeFileName = filename;
+ private byte[] getBytes(String filename) throws Exception {
+ String completeFileName = filename;
/**
* Replacing org.apache. -> org/apache/...
*/
@@ -168,7 +167,7 @@
raw = out.toByteArray();
out.close();
zin.close();
- return raw;
+ return raw;
}
}
} catch (IOException e) {
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java Mon Jul 11 08:49:30 2005
@@ -113,7 +113,7 @@
}
public DeploymentEngine(String RepositaryName, String serverXMLFile) throws DeploymentException {
- if(RepositaryName == null || RepositaryName.trim().equals("")){
+ if (RepositaryName == null || RepositaryName.trim().equals("")) {
throw new DeploymentException("Axis2 repositary can not be null");
}
this.folderName = RepositaryName;
@@ -212,10 +212,10 @@
new RepositoryListenerImpl(folderName, this);
}
try {
- ((AxisConfigurationImpl)axisConfig).setRepository(axis2repository);
+ ((AxisConfigurationImpl) axisConfig).setRepository(axis2repository);
engagdeModules();
validateSystemPredefinedPhases();
- ((AxisConfigurationImpl)axisConfig).setPhasesinfo(phasesinfo);
+ ((AxisConfigurationImpl) axisConfig).setPhasesinfo(phasesinfo);
} catch (AxisFault axisFault) {
log.info("Module validation failed" + axisFault.getMessage());
throw new DeploymentException(axisFault);
@@ -228,7 +228,7 @@
InputStream in = null;
axis2repository = clientHome;
boolean isRepositoryExist = false;
- if (!(clientHome == null ||clientHome.trim().equals(""))) {
+ if (!(clientHome == null || clientHome.trim().equals(""))) {
checkClientHome(clientHome);
isRepositoryExist = true;
try {
@@ -253,9 +253,9 @@
hotUpdate = false;
new RepositoryListenerImpl(folderName, this);
try {
- ((AxisConfigurationImpl)axisConfig).setRepository(axis2repository);
+ ((AxisConfigurationImpl) axisConfig).setRepository(axis2repository);
engagdeModules();
- ((AxisConfigurationImpl)axisConfig).setPhasesinfo(phasesinfo);
+ ((AxisConfigurationImpl) axisConfig).setPhasesinfo(phasesinfo);
} catch (AxisFault axisFault) {
log.info("Module validation failed" + axisFault.getMessage());
throw new DeploymentException(axisFault);
@@ -311,7 +311,7 @@
* are exist , or they have deployed
*/
private void engagdeModules() throws AxisFault {
- // ArrayList modules = DeploymentData.getInstance().getModules();
+ // ArrayList modules = DeploymentData.getInstance().getModules();
// PhaseResolver resolver = new PhaseResolver(axisConfig);
for (Iterator iterator = modulelist.iterator(); iterator.hasNext();) {
QName name = (QName) iterator.next();
@@ -333,7 +333,7 @@
((String) inPhases.get(2)).equals(PhaseMetadata.PHASE_DISPATCH) &&
((String) inPhases.get(3)).equals(PhaseMetadata.PHASE_POST_DISPATCH))) {
throw new DeploymentException("Invalid System predefined inphases , phase order dose not" +
- " support\n recheck axis2.xml");
+ " support\n recheck axis2.xml");
}
// ArrayList outPhaes = tempdata.getOutphases();
//TODO do the validation code here
@@ -366,13 +366,13 @@
axisConfig.addService(serviceMetaData);
ArrayList list = currentArchiveFile.getModules();
- for(int i = 0;i<list.size();i++){
- ModuleDescription module = axisConfig.getModule((QName)list.get(i));
+ for (int i = 0; i < list.size(); i++) {
+ ModuleDescription module = axisConfig.getModule((QName) list.get(i));
if (module != null) {
serviceMetaData.engageModule(module);
} else {
- throw new DeploymentException("Service " + serviceMetaData.getName().getLocalPart() +
- " Refer to invalide module " + ((QName)list.get(i)).getLocalPart());
+ throw new DeploymentException("Service " + serviceMetaData.getName().getLocalPart() +
+ " Refer to invalide module " + ((QName) list.get(i)).getLocalPart());
}
}
@@ -384,11 +384,11 @@
for (int i = 0; i < modules.size(); i++) {
QName moduleName = (QName) modules.get(i);
ModuleDescription module = axisConfig.getModule(moduleName);
- if(module != null) {
+ if (module != null) {
opDesc.engageModule(module);
} else {
- throw new DeploymentException("Operation " + opDesc.getName().getLocalPart() +
- " Refer to invalide module " + moduleName.getLocalPart());
+ throw new DeploymentException("Operation " + opDesc.getName().getLocalPart() +
+ " Refer to invalide module " + moduleName.getLocalPart());
}
}
@@ -530,12 +530,12 @@
try {
currentArchiveFile.setClassLoader();
} catch (AxisFault axisFault) {
- log.info("Setting Class Loader " +axisFault);
+ log.info("Setting Class Loader " + axisFault);
continue;
}
ArchiveReader archiveReader = new ArchiveReader();
String serviceStatus = "";
- StringWriter errorWriter= new StringWriter();
+ StringWriter errorWriter = new StringWriter();
switch (type) {
case SERVICE:
try {
@@ -648,9 +648,10 @@
/**
* while parsing the axis2.xml the module refferences have to be store some where , since at that
* time none of module availble (they load after parsing the document)
+ *
* @param moduleName <code>QName</code>
*/
- public void addModule(QName moduleName){
+ public void addModule(QName moduleName) {
modulelist.add(moduleName);
}