You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by th...@apache.org on 2005/09/15 07:22:12 UTC
svn commit: r289150 - in
/webservices/kandula/trunk/java/src/org/apache/kandula/context: ./ at/
coordination/ coordination/simple/
Author: thilina
Date: Wed Sep 14 22:21:56 2005
New Revision: 289150
URL: http://svn.apache.org/viewcvs?rev=289150&view=rev
Log: (empty)
Added:
webservices/kandula/trunk/java/src/org/apache/kandula/context/coordination/
webservices/kandula/trunk/java/src/org/apache/kandula/context/coordination/CoordinationContext.java
- copied, changed from r280847, webservices/kandula/trunk/java/src/org/apache/kandula/typemapping/CoordinationContext.java
webservices/kandula/trunk/java/src/org/apache/kandula/context/coordination/simple/
webservices/kandula/trunk/java/src/org/apache/kandula/context/coordination/simple/SimpleCoordinationContext.java
- copied, changed from r280847, webservices/kandula/trunk/java/src/org/apache/kandula/typemapping/SimpleCoordinationContext.java
Modified:
webservices/kandula/trunk/java/src/org/apache/kandula/context/ActivityContext.java
webservices/kandula/trunk/java/src/org/apache/kandula/context/ActivityContextImpl.java
webservices/kandula/trunk/java/src/org/apache/kandula/context/ContextFactory.java
webservices/kandula/trunk/java/src/org/apache/kandula/context/Participant.java
webservices/kandula/trunk/java/src/org/apache/kandula/context/at/ATActivityContext.java
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/context/ActivityContext.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/context/ActivityContext.java?rev=289150&r1=289149&r2=289150&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/context/ActivityContext.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/context/ActivityContext.java Wed Sep 14 22:21:56 2005
@@ -16,21 +16,21 @@
*/
package org.apache.kandula.context;
-import java.util.Iterator;
-
import org.apache.axis2.addressing.EndpointReference;
import org.apache.kandula.KandulaException;
-import org.apache.kandula.typemapping.CoordinationContext;
+import org.apache.kandula.context.coordination.CoordinationContext;
+
+import java.util.Iterator;
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
*/
public interface ActivityContext {
-
+
public abstract EndpointReference addParticipant(EndpointReference participantEPR, String protocol) throws KandulaException;
-
+
public abstract Iterator getRegisteredParticipants(String protocol);
-
+
public abstract Iterator getAllParticipants();
public abstract int getStatus();
@@ -40,13 +40,13 @@
public abstract void lock();
public abstract void unlock();
-
+
public abstract void setProperty(Object key, Object value);
-
+
public abstract Object getProperty(Object key);
-
+
public abstract CoordinationContext getCoordinationContext();
-
+
public abstract void setCoordinationContext(CoordinationContext context);
-
+
}
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/context/ActivityContextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/context/ActivityContextImpl.java?rev=289150&r1=289149&r2=289150&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/context/ActivityContextImpl.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/context/ActivityContextImpl.java Wed Sep 14 22:21:56 2005
@@ -16,17 +16,16 @@
*/
package org.apache.kandula.context;
-import java.util.HashMap;
-
-import javax.xml.namespace.QName;
-
import org.apache.axis2.addressing.AnyContentType;
import org.apache.axis2.addressing.EndpointReference;
+import org.apache.kandula.context.coordination.CoordinationContext;
import org.apache.kandula.Status.CoordinatorStatus;
-import org.apache.kandula.typemapping.CoordinationContext;
import org.apache.kandula.utility.EndpointReferenceFactory;
import org.apache.kandula.utility.KandulaUtils;
+import javax.xml.namespace.QName;
+import java.util.HashMap;
+
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
*/
@@ -48,7 +47,7 @@
public ActivityContextImpl(String coordinationType) {
propertyBag = new HashMap();
- activityID = KandulaUtils.getRandomStringOf18Characters();
+ activityID = KandulaUtils.getRandomStringOf18Characters();
coordinationContext = CoordinationContext.Factory.newInstance();
coordinationContext.setActivityID(activityID);
EndpointReference registrationEpr = EndpointReferenceFactory
@@ -69,6 +68,12 @@
public void setCoordinationContext(CoordinationContext context) {
this.coordinationContext = context;
}
+
+// public abstract EndpointReference addParticipant(EndpointReference participantEPR, String protocol) throws KandulaException;
+//
+// public abstract Iterator getRegisteredParticipants(String protocol);
+//
+// public abstract Iterator getAllParticipants();
public int getStatus() {
return status;
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/context/ContextFactory.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/context/ContextFactory.java?rev=289150&r1=289149&r2=289150&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/context/ContextFactory.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/context/ContextFactory.java Wed Sep 14 22:21:56 2005
@@ -19,7 +19,7 @@
import org.apache.axis2.addressing.EndpointReference;
import org.apache.kandula.KandulaException;
import org.apache.kandula.context.at.ATActivityContext;
-import org.apache.kandula.typemapping.CoordinationContext;
+import org.apache.kandula.context.coordination.CoordinationContext;
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
@@ -42,7 +42,7 @@
}
public ActivityContext createActivity(String protocol,
- EndpointReference activationEPR) throws KandulaException {
+ EndpointReference activationEPR) throws KandulaException {
if (org.apache.kandula.Constants.WS_AT.equalsIgnoreCase(protocol)) {
return new ATActivityContext(activationEPR);
} else {
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/context/Participant.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/context/Participant.java?rev=289150&r1=289149&r2=289150&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/context/Participant.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/context/Participant.java Wed Sep 14 22:21:56 2005
@@ -1,34 +1,34 @@
- /*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+/*
+* Copyright 2004 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
package org.apache.kandula.context;
import org.apache.axis2.addressing.EndpointReference;
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
- *
- * Used to store the details about the participant & to store the runtime status
- * of Participants
+ * <p/>
+ * Used to store the details about the participant & to store the runtime status
+ * of Participants
*/
public class Participant {
private EndpointReference epr;
private String protocol;
private int status;
-
+
/**
* @param epr
* @param protocol
@@ -39,16 +39,14 @@
this.epr = epr;
this.protocol = protocol;
}
-
- public void setStatus(int status)
- {
+
+ public void setStatus(int status) {
this.status = status;
}
-
- public int getStatus()
- {
+
+ public int getStatus() {
return status;
}
-
-
+
+
}
Modified: webservices/kandula/trunk/java/src/org/apache/kandula/context/at/ATActivityContext.java
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/context/at/ATActivityContext.java?rev=289150&r1=289149&r2=289150&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/context/at/ATActivityContext.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/context/at/ATActivityContext.java Wed Sep 14 22:21:56 2005
@@ -16,19 +16,20 @@
*/
package org.apache.kandula.context.at;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.LinkedList;
-
+import org.apache.axis2.addressing.EndpointReference;
import org.apache.kandula.Constants;
import org.apache.kandula.KandulaException;
import org.apache.kandula.context.ActivityContext;
import org.apache.kandula.context.ActivityContextImpl;
import org.apache.kandula.context.Participant;
-import org.apache.kandula.typemapping.CoordinationContext;
+import org.apache.kandula.context.coordination.CoordinationContext;
import org.apache.kandula.utility.EndpointReferenceFactory;
import org.apache.kandula.utility.KandulaUtils;
-import org.apache.axis2.addressing.EndpointReference;
+
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.LinkedList;
+
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
*/
@@ -64,8 +65,7 @@
}
/**
- * @param context
- * To be used when coordinator is used as a sub ordinate to an another cooordinator
+ * @param context To be used when coordinator is used as a sub ordinate to an another cooordinator
*/
public ATActivityContext(CoordinationContext context) {
subOrdinate = true;
@@ -76,12 +76,11 @@
durableParticipantsTable = new Hashtable();
setCoordinationContext(context);
}
+
/**
- * @param id
- * To be used when using as the requester
+ * @param id To be used when using as the requester
*/
- public ATActivityContext(EndpointReference activationEPR)
- {
+ public ATActivityContext(EndpointReference activationEPR) {
super();
this.setProperty(REQUESTER_ID, KandulaUtils.getRandomStringOf18Characters());
this.setProperty(ACTIVATION_EPR, activationEPR);
@@ -101,13 +100,10 @@
} else if (Constants.WS_AT_DURABLE2PC.equals(protocol)) {
addDurableParticipant(participantEPR);
return EndpointReferenceFactory.getInstance().get2PCEndpoint(this.activityID);
- }else if (Constants.WS_AT_COMPLETION.equals(protocol))
- {
+ } else if (Constants.WS_AT_COMPLETION.equals(protocol)) {
//TODO keep track of requesters
return EndpointReferenceFactory.getInstance().getCompletionEndpoint(this.activityID);
- }
- else
- {
+ } else {
throw new KandulaException("UnSupported Protocol");
}
}
@@ -151,7 +147,7 @@
}
public boolean hasMorePreparing() {
- return (preparingParticipantsCount > 0);
+ return (preparingParticipantsCount > 0);
}
public boolean getSubVolatileRegistered() {
Copied: webservices/kandula/trunk/java/src/org/apache/kandula/context/coordination/CoordinationContext.java (from r280847, webservices/kandula/trunk/java/src/org/apache/kandula/typemapping/CoordinationContext.java)
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/context/coordination/CoordinationContext.java?p2=webservices/kandula/trunk/java/src/org/apache/kandula/context/coordination/CoordinationContext.java&p1=webservices/kandula/trunk/java/src/org/apache/kandula/typemapping/CoordinationContext.java&r1=280847&r2=289150&rev=289150&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/typemapping/CoordinationContext.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/context/coordination/CoordinationContext.java Wed Sep 14 22:21:56 2005
@@ -14,11 +14,12 @@
* limitations under the License.
*
*/
-package org.apache.kandula.typemapping;
+package org.apache.kandula.context.coordination;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.om.OMElement;
import org.apache.kandula.typemapping.xmlbeansimpl.XmlBeansTypeCoordinationContext;
+import org.apache.kandula.context.coordination.simple.SimpleCoordinationContext;
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
@@ -31,7 +32,7 @@
public abstract EndpointReference getRegistrationService();
public abstract long getExpires();
-
+
public abstract void setActivityID(String value);
public abstract void setCoordinationType(String value);
@@ -39,18 +40,20 @@
public abstract void setRegistrationService(EndpointReference value);
public abstract void setExpires(long value);
-
+
public abstract OMElement toOM();
-
+
public abstract Object getCoordinationContextType();
public static final class Factory {
public static CoordinationContext newInstance() {
return new SimpleCoordinationContext();
}
+
public static CoordinationContext newInstance(OMElement contextElement) {
return new SimpleCoordinationContext(contextElement);
}
+
public static CoordinationContext newInstance(Object contextType) {
return new XmlBeansTypeCoordinationContext(contextType);
}
Copied: webservices/kandula/trunk/java/src/org/apache/kandula/context/coordination/simple/SimpleCoordinationContext.java (from r280847, webservices/kandula/trunk/java/src/org/apache/kandula/typemapping/SimpleCoordinationContext.java)
URL: http://svn.apache.org/viewcvs/webservices/kandula/trunk/java/src/org/apache/kandula/context/coordination/simple/SimpleCoordinationContext.java?p2=webservices/kandula/trunk/java/src/org/apache/kandula/context/coordination/simple/SimpleCoordinationContext.java&p1=webservices/kandula/trunk/java/src/org/apache/kandula/typemapping/SimpleCoordinationContext.java&r1=280847&r2=289150&rev=289150&view=diff
==============================================================================
--- webservices/kandula/trunk/java/src/org/apache/kandula/typemapping/SimpleCoordinationContext.java (original)
+++ webservices/kandula/trunk/java/src/org/apache/kandula/context/coordination/simple/SimpleCoordinationContext.java Wed Sep 14 22:21:56 2005
@@ -14,21 +14,21 @@
* limitations under the License.
*
*/
-package org.apache.kandula.typemapping;
-
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
+package org.apache.kandula.context.coordination.simple;
import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.addressing.AddressingConstants.Final;
import org.apache.axis2.addressing.AnyContentType;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.addressing.AddressingConstants.Final;
import org.apache.axis2.om.OMAbstractFactory;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.om.OMNamespace;
import org.apache.axis2.soap.SOAPFactory;
import org.apache.kandula.Constants;
+import org.apache.kandula.context.coordination.CoordinationContext;
+
+import javax.xml.namespace.QName;
+import java.util.Iterator;
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
@@ -46,7 +46,6 @@
public SimpleCoordinationContext() {
super();
-
}
public SimpleCoordinationContext(OMElement contextElement) {
@@ -56,7 +55,7 @@
new QName("Identifier")).getText();
coordinationType = contextElement.getFirstChildWithName(
new QName("CoordinationType")).getText();
- OMElement registrationElement = contextElement.getFirstChildWithName(
+ OMElement registrationElement = contextElement.getFirstChildWithName(
new QName("RegistrationService"));
registrationServiceEpr = new EndpointReference(registrationElement
.getFirstChildWithName(new QName("Address")).getText());
---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org