You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2011/10/22 21:30:07 UTC
svn commit: r1187758 [2/15] - in /incubator/airavata/trunk: ./
modules/commons/gfac-schema/src/main/java/org/apache/airavata/commons/gfac/type/app/
modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/
modules/commons/registry-ap...
Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/user/UserManager.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/user/UserManager.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/user/UserManager.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/user/UserManager.java Sat Oct 22 19:29:52 2011
@@ -25,166 +25,158 @@ import javax.jcr.UnsupportedRepositoryOp
import org.apache.airavata.registry.api.impl.JCRRegistry;
-
public interface UserManager {
-
/**
- * Filter flag indicating that only <code>User</code>s should be searched
- * and returned.
+ * Filter flag indicating that only <code>User</code>s should be searched and returned.
*/
int SEARCH_TYPE_USER = 1;
/**
- * Filter flag indicating that only <code>Group</code>s should be searched
- * and returned.
+ * Filter flag indicating that only <code>Group</code>s should be searched and returned.
*/
int SEARCH_TYPE_GROUP = 2;
/**
- * Filter flag indicating that all <code>Authorizable</code>s should be
- * searched.
+ * Filter flag indicating that all <code>Authorizable</code>s should be searched.
*/
int SEARCH_TYPE_AUTHORIZABLE = 3;
/**
* Get the Authorizable by its id.
- *
- * @param id The user or group id.
+ *
+ * @param id
+ * The user or group id.
* @return Authorizable or <code>null</code>, if not present.
- * @throws RepositoryException If an error occurs.
+ * @throws RepositoryException
+ * If an error occurs.
* @see Authorizable#getID()
*/
Authorizable getAuthorizable(String id) throws RepositoryException;
/**
* Get the Authorizable by its main Principal.
- *
+ *
* @param principal
* @return Authorizable or <code>null</code>, if not present.
- * @throws RepositoryException If an error occurs.
+ * @throws RepositoryException
+ * If an error occurs.
*/
- Authorizable getAuthorizable(Principal principal)
- throws RepositoryException;
+ Authorizable getAuthorizable(Principal principal) throws RepositoryException;
/**
- * Returns all <code>Authorizable</code>s that have
- * {@link Authorizable#getProperty(String) property} with the given name and
- * that Property equals the given value.
- *
+ * Returns all <code>Authorizable</code>s that have {@link Authorizable#getProperty(String) property} with the given
+ * name and that Property equals the given value.
+ *
* @param propertyName
* @param value
- * @return All <code>Authorizable</code>s that have a property with the given
- * name exactly matching the given value.
- * @throws RepositoryException If an error occurs.
+ * @return All <code>Authorizable</code>s that have a property with the given name exactly matching the given value.
+ * @throws RepositoryException
+ * If an error occurs.
* @see Authorizable#getProperty(String)
*/
- Iterator<Authorizable> findAuthorizables(String propertyName,
- String value) throws RepositoryException;
+ Iterator<Authorizable> findAuthorizables(String propertyName, String value) throws RepositoryException;
/**
- * Returns all <code>Authorizable</code>s that have
- * {@link Authorizable#getProperty(String) property} with the given name and
- * that Property equals the given value. In contrast to
- * {@link #findAuthorizables(String, String)} the type of authorizable is
- * respected while executing the search.
- *
+ * Returns all <code>Authorizable</code>s that have {@link Authorizable#getProperty(String) property} with the given
+ * name and that Property equals the given value. In contrast to {@link #findAuthorizables(String, String)} the type
+ * of authorizable is respected while executing the search.
+ *
* @param propertyName
* @param value
- * @param searchType Any of the following constants:
- * <ul>
- * <li>{@link #SEARCH_TYPE_AUTHORIZABLE}</li>
- * <li>{@link #SEARCH_TYPE_GROUP}</li>
- * <li>{@link #SEARCH_TYPE_USER}</li>
- * </ul>
+ * @param searchType
+ * Any of the following constants:
+ * <ul>
+ * <li>{@link #SEARCH_TYPE_AUTHORIZABLE}</li>
+ * <li>{@link #SEARCH_TYPE_GROUP}</li>
+ * <li>{@link #SEARCH_TYPE_USER}</li>
+ * </ul>
* @return An iterator of <code>Authorizable</code>.
- * @throws RepositoryException If an error occurs.
+ * @throws RepositoryException
+ * If an error occurs.
*/
- Iterator<Authorizable> findAuthorizables(String propertyName,
- String value, int searchType) throws RepositoryException;
+ Iterator<Authorizable> findAuthorizables(String propertyName, String value, int searchType)
+ throws RepositoryException;
/**
- * Creates an User for the given userID / password pair; neither of the
- * specified parameters can be <code>null</code>.<br>
- * Same as {@link #createUser(String,String,Principal,String)} where
- * the specified userID is equal to the principal name and the intermediate
- * path is <code>null</code>.
- *
- * @param userID The id of the new user.
- * @param password The initial password of this user.
+ * Creates an User for the given userID / password pair; neither of the specified parameters can be
+ * <code>null</code>.<br>
+ * Same as {@link #createUser(String,String,Principal,String)} where the specified userID is equal to the principal
+ * name and the intermediate path is <code>null</code>.
+ *
+ * @param userID
+ * The id of the new user.
+ * @param password
+ * The initial password of this user.
* @return The new <code>User</code>.
- * @throws AuthorizableExistsException in case the given userID is already
- * in use or another Authorizable with the same principal name exists.
- * @throws RepositoryException If another error occurs.
- */
- User createUser(String userID, String password)
- throws AuthorizableExistsException, RepositoryException;
+ * @throws AuthorizableExistsException
+ * in case the given userID is already in use or another Authorizable with the same principal name
+ * exists.
+ * @throws RepositoryException
+ * If another error occurs.
+ */
+ User createUser(String userID, String password) throws AuthorizableExistsException, RepositoryException;
/**
- * Creates an User for the given parameters. If the implementation is not
- * able to deal with the <code>intermediatePath</code> that parameter should
- * be ignored.
- * Except for the <code>intermediatePath</code>, neither of the specified
- * parameters can be <code>null</code>.
- *
+ * Creates an User for the given parameters. If the implementation is not able to deal with the
+ * <code>intermediatePath</code> that parameter should be ignored. Except for the <code>intermediatePath</code>,
+ * neither of the specified parameters can be <code>null</code>.
+ *
* @param userID
* @param password
* @param principal
* @param intermediatePath
* @return The new <code>User</code>.
- * @throws AuthorizableExistsException in case the given userID is already
- * in use or another Authorizable with the same principal name exists.
- * @throws RepositoryException If the current Session is
- * not allowed to create users or some another error occurs.
+ * @throws AuthorizableExistsException
+ * in case the given userID is already in use or another Authorizable with the same principal name
+ * exists.
+ * @throws RepositoryException
+ * If the current Session is not allowed to create users or some another error occurs.
*/
- User createUser(String userID, String password,
- Principal principal, String intermediatePath)
+ User createUser(String userID, String password, Principal principal, String intermediatePath)
throws AuthorizableExistsException, RepositoryException;
/**
- * Creates a new <code>Group</code> that is based on the given principal.
- * Note that the group's ID is implementation specific. The implementation
- * may take the principal name as ID hint but must in any case assert that
- * it is unique among the IDs known to this manager.
- *
- * @param principal A non-null <code>Principal</code>
+ * Creates a new <code>Group</code> that is based on the given principal. Note that the group's ID is implementation
+ * specific. The implementation may take the principal name as ID hint but must in any case assert that it is unique
+ * among the IDs known to this manager.
+ *
+ * @param principal
+ * A non-null <code>Principal</code>
* @return The new <code>Group</code>.
- * @throws AuthorizableExistsException in case the given principal is already
- * in use with another Authorizable.
- * @throws RepositoryException If another error occurs.
- */
- Group createGroup(Principal principal)
- throws AuthorizableExistsException, RepositoryException;
+ * @throws AuthorizableExistsException
+ * in case the given principal is already in use with another Authorizable.
+ * @throws RepositoryException
+ * If another error occurs.
+ */
+ Group createGroup(Principal principal) throws AuthorizableExistsException, RepositoryException;
/**
- * Creates a new <code>Group</code> that is based on the given principal
- * and the specified <code>itermediatePath</code> hint. If the implementation
- * is not able to deal with the <code>itermediatePath</code> this parameter
- * should be ignored.
- *
+ * Creates a new <code>Group</code> that is based on the given principal and the specified
+ * <code>itermediatePath</code> hint. If the implementation is not able to deal with the
+ * <code>itermediatePath</code> this parameter should be ignored.
+ *
* @param principal
* @param intermediatePath
* @return The new <code>Group</code>.
- * @throws AuthorizableExistsException in case the given principal is already
- * in use with another Authorizable.
- * @throws RepositoryException If another error occurs.
+ * @throws AuthorizableExistsException
+ * in case the given principal is already in use with another Authorizable.
+ * @throws RepositoryException
+ * If another error occurs.
*/
- Group createGroup(Principal principal, String intermediatePath)
- throws AuthorizableExistsException, RepositoryException;
+ Group createGroup(Principal principal, String intermediatePath) throws AuthorizableExistsException,
+ RepositoryException;
/**
- * If any write operations executed through the User API are automatically
- * persisted this method returns <code>true</code>. In this case there are
- * no pending transient changes left and there is no need to explicitely call
- * {@link javax.jcr.Session#save()}. If this method returns <code>false</code>
- * any changes must be completed by an extra save call on the
- * <code>Session</code> associated with this <code>UserManager</code>.
- *
- * @return <code>true</code> if changes are automatically persisted;
- * <code>false</code> if changes made through this API (including method
- * calls on {@link Authorizable} and subclasses are only transient and
- * must be persisted using {@link javax.jcr.Session#save()}.
- * @throws RepositoryException
+ * If any write operations executed through the User API are automatically persisted this method returns
+ * <code>true</code>. In this case there are no pending transient changes left and there is no need to explicitely
+ * call {@link javax.jcr.Session#save()}. If this method returns <code>false</code> any changes must be completed by
+ * an extra save call on the <code>Session</code> associated with this <code>UserManager</code>.
+ *
+ * @return <code>true</code> if changes are automatically persisted; <code>false</code> if changes made through this
+ * API (including method calls on {@link Authorizable} and subclasses are only transient and must be
+ * persisted using {@link javax.jcr.Session#save()}.
+ * @throws RepositoryException
* @see #autoSave(boolean)
*/
boolean isAutoSave() throws RepositoryException;
@@ -192,21 +184,20 @@ public interface UserManager {
/**
* Changes the auto save behavior of this <code>UserManager</code>.
* <p/>
- * Note, that this shouldn't be allowed in cases where the associated session
- * is different from the original session accessing the user manager.
- *
- * @param enable If <code>true</code> changes made through this API will
- * be automatically saved; otherwise an explict call to
- * {@link javax.jcr.Session#save()} is required in order to persist changes.
- * @throws UnsupportedRepositoryOperationException If the implementation
- * does not allow to change the auto save behavior.
- * @throws RepositoryException If some other error occurs.
+ * Note, that this shouldn't be allowed in cases where the associated session is different from the original session
+ * accessing the user manager.
+ *
+ * @param enable
+ * If <code>true</code> changes made through this API will be automatically saved; otherwise an explict
+ * call to {@link javax.jcr.Session#save()} is required in order to persist changes.
+ * @throws UnsupportedRepositoryOperationException
+ * If the implementation does not allow to change the auto save behavior.
+ * @throws RepositoryException
+ * If some other error occurs.
*/
- void autoSave(boolean enable)
- throws UnsupportedRepositoryOperationException,
- RepositoryException;
-
+ void autoSave(boolean enable) throws UnsupportedRepositoryOperationException, RepositoryException;
+
void setRepository(JCRRegistry repository);
-
+
JCRRegistry getRepository();
}
\ No newline at end of file
Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/user/UserManagerFactory.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/user/UserManagerFactory.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/user/UserManagerFactory.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/user/UserManagerFactory.java Sat Oct 22 19:29:52 2011
@@ -7,31 +7,31 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class UserManagerFactory {
- private static Map<String,String> userManagers=new HashMap<String, String>();
- private static Logger log = LoggerFactory.getLogger(UserManagerFactory.class);
+ private static Map<String, String> userManagers = new HashMap<String, String>();
+ private static Logger log = LoggerFactory.getLogger(UserManagerFactory.class);
- public static UserManager getUserManager(String userManagerKey) throws Exception{
- if (userManagers.containsKey(userManagerKey)){
- String userManagerClass = userManagers.get(userManagerKey);
- try {
- return (UserManager)Class.forName(userManagerClass).newInstance();
- } catch (Exception e) {
- log.error("Error retrieving user manager for key "+userManagerKey,e);
- throw e;
- }
- }
- return null;
- }
-
- public static void registerUserManager(String userManagerKey, String userManagerClassName){
- userManagers.put(userManagerKey, userManagerClassName);
- }
-
- public static void registerUserManager(String userManagerKey, Class<?> userManagerClass){
- registerUserManager(userManagerKey,userManagerClass.getCanonicalName());
- }
-
- public static void registerUserManager(String userManagerKey, UserManager userManagerObj){
- registerUserManager(userManagerKey, userManagerObj.getClass());
- }
+ public static UserManager getUserManager(String userManagerKey) throws Exception {
+ if (userManagers.containsKey(userManagerKey)) {
+ String userManagerClass = userManagers.get(userManagerKey);
+ try {
+ return (UserManager) Class.forName(userManagerClass).newInstance();
+ } catch (Exception e) {
+ log.error("Error retrieving user manager for key " + userManagerKey, e);
+ throw e;
+ }
+ }
+ return null;
+ }
+
+ public static void registerUserManager(String userManagerKey, String userManagerClassName) {
+ userManagers.put(userManagerKey, userManagerClassName);
+ }
+
+ public static void registerUserManager(String userManagerKey, Class<?> userManagerClass) {
+ registerUserManager(userManagerKey, userManagerClass.getCanonicalName());
+ }
+
+ public static void registerUserManager(String userManagerKey, UserManager userManagerObj) {
+ registerUserManager(userManagerKey, userManagerObj.getClass());
+ }
}
Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java Sat Oct 22 19:29:52 2011
@@ -15,15 +15,16 @@ public class WebServiceUtil {
builder.append("<wsdl:types>");
builder.append("<xs:schema attributeFormDefault=\"qualified\" elementFormDefault=\"unqualified\" targetNamespace=\"http://www.wso2.org/types\">");
- boolean isInputParametersPresent = service.getInputParameters() != null && service.getInputParameters().length > 0;
- if (isInputParametersPresent) {
+ boolean isInputParametersPresent = service.getInputParameters() != null
+ && service.getInputParameters().length > 0;
+ if (isInputParametersPresent) {
builder.append("<xs:element name=\"invoke\">");
builder.append("<xs:complexType>");
builder.append("<xs:sequence>");
ServiceDescriptionType p = service.getServiceDescriptionType();
- for (int i=0; i<p.getInputParametersArray().length; i++) {
+ for (int i = 0; i < p.getInputParametersArray().length; i++) {
generateElementFromType(p.getInputParametersArray(i), builder);
}
@@ -32,15 +33,16 @@ public class WebServiceUtil {
builder.append("</xs:element>");
}
- boolean isOutputParametersPresent = service.getOutputParameters() != null && service.getOutputParameters().length > 0;
- if (isOutputParametersPresent) {
+ boolean isOutputParametersPresent = service.getOutputParameters() != null
+ && service.getOutputParameters().length > 0;
+ if (isOutputParametersPresent) {
builder.append("<xs:element name=\"invokeResponse\">");
builder.append("<xs:complexType>");
builder.append("<xs:sequence>");
ServiceDescriptionType p = service.getServiceDescriptionType();
- for (int i=0; i<p.getOutputParametersArray().length; i++) {
+ for (int i = 0; i < p.getOutputParametersArray().length; i++) {
generateElementFromType(p.getOutputParametersArray(i), builder);
}
@@ -54,13 +56,13 @@ public class WebServiceUtil {
builder.append("<wsdl:message name=\"invokeRequest\">");
if (isInputParametersPresent) {
- builder.append("<wsdl:part name=\"parameters\" element=\"ns:invoke\"/>");
- }
- builder.append("</wsdl:message>");
+ builder.append("<wsdl:part name=\"parameters\" element=\"ns:invoke\"/>");
+ }
+ builder.append("</wsdl:message>");
if (isOutputParametersPresent) {
- builder.append("<wsdl:message name=\"invokeResponse\">");
- builder.append("<wsdl:part name=\"parameters\" element=\"ns:invokeResponse\"/>");
- builder.append("</wsdl:message>");
+ builder.append("<wsdl:message name=\"invokeResponse\">");
+ builder.append("<wsdl:part name=\"parameters\" element=\"ns:invokeResponse\"/>");
+ builder.append("</wsdl:message>");
}
builder.append("<wsdl:portType name=\"");
@@ -69,8 +71,8 @@ public class WebServiceUtil {
builder.append("<wsdl:operation name=\"invoke\">");
builder.append("<wsdl:input message=\"ns:invokeRequest\" wsaw:Action=\"urn:invoke\"/>");
if (isOutputParametersPresent) {
- builder.append("<wsdl:output message=\"ns:invokeResponse\" wsaw:Action=\"urn:invokeResponse\"/>");
- }
+ builder.append("<wsdl:output message=\"ns:invokeResponse\" wsaw:Action=\"urn:invokeResponse\"/>");
+ }
builder.append("</wsdl:operation>");
builder.append("</wsdl:portType>");
@@ -81,33 +83,32 @@ public class WebServiceUtil {
private static void generateElementFromType(Parameter parameter, StringBuilder builder) {
String type = parameter.getType().getType().toString();
- if (type.equals("String")){
+ if (type.equals("String")) {
builder.append("<xs:element minOccurs=\"0\" name=\"");
builder.append(parameter.getName());
builder.append("\" nillable=\"true\" type=\"xs:string\"/>");
- } else if (type.equals("Integer")){
- builder.append("<xs:element minOccurs=\"0\" name=\"");
+ } else if (type.equals("Integer")) {
+ builder.append("<xs:element minOccurs=\"0\" name=\"");
builder.append(parameter.getName());
builder.append("\" type=\"xs:int\"/>");
- } else if (type.equals("Boolean")){
- builder.append("<xs:element minOccurs=\"0\" name=\"");
+ } else if (type.equals("Boolean")) {
+ builder.append("<xs:element minOccurs=\"0\" name=\"");
builder.append(parameter.getName());
builder.append("\" type=\"xs:boolean\"/>");
- } else if (type.equals("Double")){
- builder.append("<xs:element minOccurs=\"0\" name=\"");
+ } else if (type.equals("Double")) {
+ builder.append("<xs:element minOccurs=\"0\" name=\"");
builder.append(parameter.getName());
builder.append("\" type=\"xs:double\"/>");
- } else if (type.equals("Float")){
- builder.append("<xs:element minOccurs=\"0\" name=\"");
+ } else if (type.equals("Float")) {
+ builder.append("<xs:element minOccurs=\"0\" name=\"");
builder.append(parameter.getName());
builder.append("\" type=\"xs:float\"/>");
- } else if (type.equals("File")){
- //TODO adding this means adding a new complex type for File type
-// builder.append("<xs:element minOccurs=\"0\" name=\"");
-// builder.append(parameter.getName());
-// builder.append("\" nillable=\"true\" type=\"ax22:File\"/>");
- }
-
+ } else if (type.equals("File")) {
+ // TODO adding this means adding a new complex type for File type
+ // builder.append("<xs:element minOccurs=\"0\" name=\"");
+ // builder.append(parameter.getName());
+ // builder.append("\" nillable=\"true\" type=\"ax22:File\"/>");
+ }
}
Modified: incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/UtilsException.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/UtilsException.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/UtilsException.java (original)
+++ incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/UtilsException.java Sat Oct 22 19:29:52 2011
@@ -17,14 +17,14 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
package org.apache.airavata.common.exception;
public class UtilsException extends Exception {
/**
* Constructs a UtilsException.
- *
+ *
*/
public UtilsException() {
super();
@@ -32,7 +32,7 @@ public class UtilsException extends Exce
/**
* Constructs a UtilsException.
- *
+ *
* @param message
*/
public UtilsException(String message) {
@@ -41,7 +41,7 @@ public class UtilsException extends Exce
/**
* Constructs a UtilsException.
- *
+ *
* @param cause
*/
public UtilsException(Throwable cause) {
@@ -50,7 +50,7 @@ public class UtilsException extends Exce
/**
* Constructs a UtilsException.
- *
+ *
* @param message
* @param cause
*/
Modified: incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/IOUtil.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/IOUtil.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/IOUtil.java (original)
+++ incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/IOUtil.java Sat Oct 22 19:29:52 2011
@@ -46,7 +46,7 @@ public class IOUtil {
* @throws IOException
*/
public static void writeToFile(String content, String path) throws IOException {
- logger.debug("Path:" + path + " Content:" + content );
+ logger.debug("Path:" + path + " Content:" + content);
FileWriter fw = new FileWriter(path);
writeToWriter(content, fw);
Modified: incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/WSDLUtil.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/WSDLUtil.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/WSDLUtil.java (original)
+++ incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/WSDLUtil.java Sat Oct 22 19:29:52 2011
@@ -147,8 +147,7 @@ public class WSDLUtil {
* @return The name of the first operation in a given portType.
* @throws UtilsException
*/
- public static String getFirstOperationName(WsdlDefinitions definitions, QName portTypeQName)
- throws UtilsException {
+ public static String getFirstOperationName(WsdlDefinitions definitions, QName portTypeQName) throws UtilsException {
WsdlPortType portType = definitions.getPortType(portTypeQName.getLocalPart());
for (WsdlPortTypeOperation operation : portType.operations()) {
String operationName = operation.getOperationName();
@@ -171,7 +170,7 @@ public class WSDLUtil {
* @param definitions
* @return The cloned WsdlDefinitions
*/
- public static WsdlDefinitions deepClone(WsdlDefinitions definitions)throws UtilsException {
+ public static WsdlDefinitions deepClone(WsdlDefinitions definitions) throws UtilsException {
return new WsdlDefinitions(XMLUtil.deepClone(definitions.xml()));
}
@@ -269,13 +268,14 @@ public class WSDLUtil {
}
/**
- *
+ *
* @param definitions
* @param paramType
* @return
*/
- public static XmlElement getImportContainingTypeDefinition(WsdlDefinitions definitions, QName paramType)throws UtilsException{
+ public static XmlElement getImportContainingTypeDefinition(WsdlDefinitions definitions, QName paramType)
+ throws UtilsException {
XmlElement types = definitions.getTypes();
XmlElement returnType = null;
Iterable<XmlElement> schemas = types.elements(WSConstants.XSD_NS, WSConstants.SCHEMA_TAG);
@@ -310,13 +310,14 @@ public class WSDLUtil {
}
/**
- *
+ *
* @param definitions
* @param paramType
* @return
*/
- public static XmlElement findTypeDefinitionInImports(WsdlDefinitions definitions, QName paramType)throws UtilsException {
+ public static XmlElement findTypeDefinitionInImports(WsdlDefinitions definitions, QName paramType)
+ throws UtilsException {
XmlElement types = definitions.getTypes();
XmlElement returnType = null;
Iterable<XmlElement> schemas = types.elements(null, WSConstants.SCHEMA_TAG);
@@ -469,8 +470,6 @@ public class WSDLUtil {
return uri;
}
-
-
/**
* @param valueElement
* @return
@@ -482,7 +481,7 @@ public class WSDLUtil {
}
/**
- *
+ *
* @param vals
* @param <T>
* @return
Modified: incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/XMLUtil.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/XMLUtil.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/XMLUtil.java (original)
+++ incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/XMLUtil.java Sat Oct 22 19:29:52 2011
@@ -242,7 +242,8 @@ public class XMLUtil {
* @param element
* @return The cloned XmlElement.
*/
- public static org.xmlpull.infoset.XmlElement deepClone(org.xmlpull.infoset.XmlElement element)throws UtilsException{
+ public static org.xmlpull.infoset.XmlElement deepClone(org.xmlpull.infoset.XmlElement element)
+ throws UtilsException {
try {
XmlElement clonedElement = element.clone();
clonedElement.setParent(null);
@@ -408,7 +409,7 @@ public class XMLUtil {
}
/**
- *
+ *
* @param xml
* @param name
*/
@@ -493,73 +494,72 @@ public class XMLUtil {
/**
* Check two XmlElements are equal with the Xml content or not
+ *
* @param elem1
* @param elem2
* @return
*/
- public static boolean isEqual(XmlElement elem1, XmlElement elem2) throws Exception{
+ public static boolean isEqual(XmlElement elem1, XmlElement elem2) throws Exception {
- if (elem1 == null && elem2 == null) {
- return true;
- } else if (elem1 == null) {
- return false;
- } else if (elem2 == null) {
- return false;
- }
-
- if (!elem1.getName().equals(elem2.getName())) {
- return false;
- } else {
- // now check if children are the same
- Iterator children1 = elem1.children().iterator();
- Iterator children2 = elem2.children().iterator();
- while (children1.hasNext()) {
- Object child = children1.next();
-
- if (child instanceof String) {
- //check whether this is the only string
- //if yes this is text val otherwise its a text
- //among the elements so ignore
- if(children1.hasNext()){
- continue;
- }else{
- //this is a text node
- if (children2.hasNext()) {
- Object child2Obj = children2.next();
- if (child2Obj instanceof String) {
- return child.equals(child2Obj);
- }
- }
- return false;
- }
-
- } else if (child instanceof XmlElement) {
- if (children2.hasNext()) {
- Object child2Obj = children2.next();
- if (child2Obj instanceof String) {
- child2Obj = children2.next();
- }
- if (child2Obj instanceof XmlElement) {
- if (!isEqual((XmlElement) child,
- (XmlElement) child2Obj)) {
- return false;
- }
- } else {
- return false;
- }
- } else {
- // childrens2 ran out of elements
- return false;
- }
-
- } else {
- throw new Exception(
- "Unhandled element type found" + child);
- }
- }
- return true;
- }
+ if (elem1 == null && elem2 == null) {
+ return true;
+ } else if (elem1 == null) {
+ return false;
+ } else if (elem2 == null) {
+ return false;
+ }
- }
+ if (!elem1.getName().equals(elem2.getName())) {
+ return false;
+ } else {
+ // now check if children are the same
+ Iterator children1 = elem1.children().iterator();
+ Iterator children2 = elem2.children().iterator();
+ while (children1.hasNext()) {
+ Object child = children1.next();
+
+ if (child instanceof String) {
+ // check whether this is the only string
+ // if yes this is text val otherwise its a text
+ // among the elements so ignore
+ if (children1.hasNext()) {
+ continue;
+ } else {
+ // this is a text node
+ if (children2.hasNext()) {
+ Object child2Obj = children2.next();
+ if (child2Obj instanceof String) {
+ return child.equals(child2Obj);
+ }
+ }
+ return false;
+ }
+
+ } else if (child instanceof XmlElement) {
+ if (children2.hasNext()) {
+ Object child2Obj = children2.next();
+ if (child2Obj instanceof String) {
+ child2Obj = children2.next();
+ }
+ if (child2Obj instanceof XmlElement) {
+ if (!isEqual((XmlElement) child, (XmlElement) child2Obj)) {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ } else {
+ // childrens2 ran out of elements
+ return false;
+ }
+
+ } else {
+ throw new Exception("Unhandled element type found" + child);
+ }
+ }
+ return true;
+ }
+
+ }
}
\ No newline at end of file
Modified: incubator/airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java (original)
+++ incubator/airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java Sat Oct 22 19:29:52 2011
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
package org.apache.airavata.common.workflow.execution.context;
import org.apache.airavata.common.utils.XMLUtil;
@@ -40,15 +40,16 @@ public class WorkflowContextHeaderBuilde
private WorkflowSchedulingContextDocument.WorkflowSchedulingContext workflowSchedulingContext = null;
-
- public WorkflowContextHeaderBuilder(String brokerUrl, String gfacUrl, String registryUrl, String experimentId, String workflowId) {
+ public WorkflowContextHeaderBuilder(String brokerUrl, String gfacUrl, String registryUrl, String experimentId,
+ String workflowId) {
this.contextHeader = ContextHeaderDocument.ContextHeader.Factory.newInstance();
this.soaServiceEprs = SoaServiceEprsDocument.SoaServiceEprs.Factory.newInstance();
this.soaServiceEprs.setGfacUrl(gfacUrl);
this.soaServiceEprs.setRegistryUrl(registryUrl);
- this.workflowMonitoringContext = WorkflowMonitoringContextDocument.WorkflowMonitoringContext.Factory.newInstance();
+ this.workflowMonitoringContext = WorkflowMonitoringContextDocument.WorkflowMonitoringContext.Factory
+ .newInstance();
this.workflowMonitoringContext.setEventPublishEpr(brokerUrl);
this.workflowMonitoringContext.setWorkflowInstanceId(workflowId);
this.workflowMonitoringContext.setExperimentId(experimentId);
@@ -57,22 +58,24 @@ public class WorkflowContextHeaderBuilde
this.contextHeader.setSoaServiceEprs(this.soaServiceEprs);
this.contextHeader.setSecurityContext(SecurityContextDocument.SecurityContext.Factory.newInstance());
- this.contextHeader.setWorkflowSchedulingContext(WorkflowSchedulingContextDocument.WorkflowSchedulingContext.Factory.newInstance());
+ this.contextHeader
+ .setWorkflowSchedulingContext(WorkflowSchedulingContextDocument.WorkflowSchedulingContext.Factory
+ .newInstance());
}
- public WorkflowContextHeaderBuilder setWorkflowMonitoringContext(WorkflowMonitoringContextDocument.WorkflowMonitoringContext workflowMonitoringContext) {
+ public WorkflowContextHeaderBuilder setWorkflowMonitoringContext(
+ WorkflowMonitoringContextDocument.WorkflowMonitoringContext workflowMonitoringContext) {
this.workflowMonitoringContext = workflowMonitoringContext;
return this;
}
-
public WorkflowContextHeaderBuilder setSecurityContext(SecurityContextDocument.SecurityContext securityContext) {
this.securityContext = securityContext;
return this;
}
-
- public WorkflowContextHeaderBuilder setWorkflowOutputDataHandling(WorkflowOutputDataHandlingDocument.WorkflowOutputDataHandling workflowOutputDataHandling) {
+ public WorkflowContextHeaderBuilder setWorkflowOutputDataHandling(
+ WorkflowOutputDataHandlingDocument.WorkflowOutputDataHandling workflowOutputDataHandling) {
this.workflowOutputDataHandling = workflowOutputDataHandling;
return this;
}
@@ -87,7 +90,8 @@ public class WorkflowContextHeaderBuilde
return this;
}
- public WorkflowContextHeaderBuilder setWorkflowSchedulingContext(WorkflowSchedulingContextDocument.WorkflowSchedulingContext workflowSchedulingContext) {
+ public WorkflowContextHeaderBuilder setWorkflowSchedulingContext(
+ WorkflowSchedulingContextDocument.WorkflowSchedulingContext workflowSchedulingContext) {
this.workflowSchedulingContext = workflowSchedulingContext;
return this;
}
@@ -116,7 +120,6 @@ public class WorkflowContextHeaderBuilde
return userIdentifier;
}
-
public WorkflowMonitoringContextDocument.WorkflowMonitoringContext getWorkflowMonitoringContext() {
return workflowMonitoringContext;
}
@@ -186,11 +189,13 @@ public class WorkflowContextHeaderBuilde
return this;
}
- public WorkflowContextHeaderBuilder setGridMyProxyRepository(String myProxyServer, String userName, String password, int lifeTimeInHours) {
+ public WorkflowContextHeaderBuilder setGridMyProxyRepository(String myProxyServer, String userName,
+ String password, int lifeTimeInHours) {
if (this.securityContext == null) {
this.securityContext = SecurityContextDocument.SecurityContext.Factory.newInstance();
}
- SecurityContextDocument.SecurityContext.GridMyproxyRepository gridMyproxyRepository = this.securityContext.addNewGridMyproxyRepository();
+ SecurityContextDocument.SecurityContext.GridMyproxyRepository gridMyproxyRepository = this.securityContext
+ .addNewGridMyproxyRepository();
gridMyproxyRepository.setMyproxyServer(myProxyServer);
gridMyproxyRepository.setUsername(userName);
gridMyproxyRepository.setPassword(password);
@@ -202,7 +207,8 @@ public class WorkflowContextHeaderBuilde
if (this.securityContext == null) {
this.securityContext = SecurityContextDocument.SecurityContext.Factory.newInstance();
}
- SecurityContextDocument.SecurityContext.SshAuthentication sshAuthentication = this.securityContext.addNewSshAuthentication();
+ SecurityContextDocument.SecurityContext.SshAuthentication sshAuthentication = this.securityContext
+ .addNewSshAuthentication();
sshAuthentication.setAccessKeyId(accessKeyId);
sshAuthentication.setSecretAccessKey(secretKeyId);
return this;
@@ -212,7 +218,8 @@ public class WorkflowContextHeaderBuilde
if (this.securityContext == null) {
this.securityContext = SecurityContextDocument.SecurityContext.Factory.newInstance();
}
- SecurityContextDocument.SecurityContext.CredentialManagementService credentialManagementService = this.securityContext.addNewCredentialManagementService();
+ SecurityContextDocument.SecurityContext.CredentialManagementService credentialManagementService = this.securityContext
+ .addNewCredentialManagementService();
credentialManagementService.setScmsUrl(scmUrl);
credentialManagementService.setExecutionSessionId(securitySessionId);
return this;
@@ -222,29 +229,36 @@ public class WorkflowContextHeaderBuilde
if (this.securityContext == null) {
this.securityContext = SecurityContextDocument.SecurityContext.Factory.newInstance();
}
- SecurityContextDocument.SecurityContext.AmazonWebservices amazonWebservices = this.securityContext.addNewAmazonWebservices();
+ SecurityContextDocument.SecurityContext.AmazonWebservices amazonWebservices = this.securityContext
+ .addNewAmazonWebservices();
amazonWebservices.setSecretAccessKey(accessKeyId);
amazonWebservices.setSecretAccessKey(secretAccesKey);
return this;
}
- public WorkflowContextHeaderBuilder addApplicationOutputDataHandling(String outputDir, String outputDataRegistry, boolean dataPersistence) {
+ public WorkflowContextHeaderBuilder addApplicationOutputDataHandling(String outputDir, String outputDataRegistry,
+ boolean dataPersistence) {
if (this.workflowOutputDataHandling == null) {
- this.workflowOutputDataHandling = WorkflowOutputDataHandlingDocument.WorkflowOutputDataHandling.Factory.newInstance();
+ this.workflowOutputDataHandling = WorkflowOutputDataHandlingDocument.WorkflowOutputDataHandling.Factory
+ .newInstance();
}
- ApplicationOutputDataHandlingDocument.ApplicationOutputDataHandling applicationOutputDataHandling = this.workflowOutputDataHandling.addNewApplicationOutputDataHandling();
+ ApplicationOutputDataHandlingDocument.ApplicationOutputDataHandling applicationOutputDataHandling = this.workflowOutputDataHandling
+ .addNewApplicationOutputDataHandling();
applicationOutputDataHandling.setOutputDataDirectory(outputDir);
applicationOutputDataHandling.setDataRegistryUrl(outputDataRegistry);
applicationOutputDataHandling.setDataPersistance(dataPersistence);
return this;
}
- public WorkflowContextHeaderBuilder addApplicationSchedulingContext
- (String workflowNodeId, String serviceId, String hostName, boolean wsGramPreffered, String gateKeepersEpr, String jobManager, int cpuCount, int nodeCount, String qName, int maxWalTime) {
+ public WorkflowContextHeaderBuilder addApplicationSchedulingContext(String workflowNodeId, String serviceId,
+ String hostName, boolean wsGramPreffered, String gateKeepersEpr, String jobManager, int cpuCount,
+ int nodeCount, String qName, int maxWalTime) {
if (this.workflowSchedulingContext == null) {
- this.workflowSchedulingContext = WorkflowSchedulingContextDocument.WorkflowSchedulingContext.Factory.newInstance();
+ this.workflowSchedulingContext = WorkflowSchedulingContextDocument.WorkflowSchedulingContext.Factory
+ .newInstance();
}
- ApplicationSchedulingContextDocument.ApplicationSchedulingContext applicationSchedulingContext = this.workflowSchedulingContext.addNewApplicationSchedulingContext();
+ ApplicationSchedulingContextDocument.ApplicationSchedulingContext applicationSchedulingContext = this.workflowSchedulingContext
+ .addNewApplicationSchedulingContext();
applicationSchedulingContext.setWorkflowNodeId(workflowNodeId);
applicationSchedulingContext.setCpuCount(cpuCount);
applicationSchedulingContext.setGatekeeperEpr(gateKeepersEpr);
Modified: incubator/airavata/trunk/modules/commons/workflow-execution-context/src/test/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/workflow-execution-context/src/test/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilderTest.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/workflow-execution-context/src/test/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilderTest.java (original)
+++ incubator/airavata/trunk/modules/commons/workflow-execution-context/src/test/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilderTest.java Sat Oct 22 19:29:52 2011
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
package org.apache.airavata.common.workflow.execution.context;
import org.apache.airavata.common.utils.XMLUtil;
@@ -26,18 +26,20 @@ import org.junit.Test;
import java.io.File;
public class WorkflowContextHeaderBuilderTest {
- @Test
- public void testExecute() {
- WorkflowContextHeaderBuilder builder = new WorkflowContextHeaderBuilder("brokerurl","gfacurl","registryurl","experimentid","workflowid");
+ @Test
+ public void testExecute() {
+ WorkflowContextHeaderBuilder builder = new WorkflowContextHeaderBuilder("brokerurl", "gfacurl", "registryurl",
+ "experimentid", "workflowid");
- try {
- File testFile = new File(this.getClass().getClassLoader().getResource("result.xml").getPath());
- System.out.println(XMLUtil.xmlElementToString(XMLUtil.xmlElement3ToXmlElement5(builder.getXml())));
- System.out.println(XMLUtil.xmlElementToString(XMLUtil.loadXML(testFile)));
- org.junit.Assert.assertTrue(XMLUtil.isEqual(XMLUtil.loadXML(testFile), XMLUtil.xmlElement3ToXmlElement5(builder.getXml())));
- } catch (Exception e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
+ try {
+ File testFile = new File(this.getClass().getClassLoader().getResource("result.xml").getPath());
+ System.out.println(XMLUtil.xmlElementToString(XMLUtil.xmlElement3ToXmlElement5(builder.getXml())));
+ System.out.println(XMLUtil.xmlElementToString(XMLUtil.loadXML(testFile)));
+ org.junit.Assert.assertTrue(XMLUtil.isEqual(XMLUtil.loadXML(testFile),
+ XMLUtil.xmlElement3ToXmlElement5(builder.getXml())));
+ } catch (Exception e) {
+ e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
+ }
+ }
}
Modified: incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/AbstractNotifier.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/AbstractNotifier.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/AbstractNotifier.java (original)
+++ incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/AbstractNotifier.java Sat Oct 22 19:29:52 2011
@@ -54,8 +54,8 @@ public abstract class AbstractNotifier {
}
- public WorkflowTrackingContext createTrackingContext(Properties golbalProperties, String epr,
- URI workflowID, URI serviceID, String workflowNodeID, Integer workflowTimestep) {
+ public WorkflowTrackingContext createTrackingContext(Properties golbalProperties, String epr, URI workflowID,
+ URI serviceID, String workflowNodeID, Integer workflowTimestep) {
WorkflowTrackingContext workflowTrackingContext = new WorkflowTrackingContext();
workflowTrackingContext.setGlobalAnnotations(golbalProperties);
workflowTrackingContext.setBrokerEpr(new EndpointReference(epr));
@@ -131,19 +131,21 @@ public abstract class AbstractNotifier {
BaseNotificationType xmlMessage = XmlBeanUtils.extractBaseNotificationType(xmldata);
NotificationPublisher publisher = publishermap.get(context.getBrokerEpr());
try {
- if (publisher == null) {
- // if a publisher class name has been defined to override the default WSM publisher, use it
- if (context.getPublisherImpl() != null) {
- publisher = PublisherFactory.createSomePublisher(context.getPublisherImpl(), context);
- } else {
- if(context.getTopic() == null){
- publisher = new WSMPublisher(100,context.isEnableAsyncPublishing(),context.getBrokerEpr().getAddress(),false);
- }else{
- publisher = new WSMPublisher(100, context.isEnableAsyncPublishing(), context.getBrokerEpr().getAddress(),context.getTopic());
+ if (publisher == null) {
+ // if a publisher class name has been defined to override the default WSM publisher, use it
+ if (context.getPublisherImpl() != null) {
+ publisher = PublisherFactory.createSomePublisher(context.getPublisherImpl(), context);
+ } else {
+ if (context.getTopic() == null) {
+ publisher = new WSMPublisher(100, context.isEnableAsyncPublishing(), context.getBrokerEpr()
+ .getAddress(), false);
+ } else {
+ publisher = new WSMPublisher(100, context.isEnableAsyncPublishing(), context.getBrokerEpr()
+ .getAddress(), context.getTopic());
+ }
}
+ publishermap.put(context.getBrokerEpr(), publisher);
}
- publishermap.put(context.getBrokerEpr(), publisher);
- }
setIDAndTimestamp(context, xmlMessage, context.getMyself(), activityTimestamp != null ? activityTimestamp
: new Date());
@@ -155,7 +157,7 @@ public abstract class AbstractNotifier {
publisher.publish(xmldata);
} catch (RuntimeException e) {
throw new WorkflowTrackingException(e);
- } catch (IOException e){
+ } catch (IOException e) {
throw new WorkflowTrackingException(e);
}
}
Modified: incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/GenericNotifier.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/GenericNotifier.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/GenericNotifier.java (original)
+++ incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/GenericNotifier.java Sat Oct 22 19:29:52 2011
@@ -53,8 +53,8 @@ public interface GenericNotifier {
* @param epr
* @return
*/
- public WorkflowTrackingContext createTrackingContext(Properties golbalProperties, String epr,
- URI workflowID, URI serviceID, String workflowNodeID, Integer workflowTimestep);
+ public WorkflowTrackingContext createTrackingContext(Properties golbalProperties, String epr, URI workflowID,
+ URI serviceID, String workflowNodeID, Integer workflowTimestep);
/**
* Method createInitialContext. This is called when this invocation was not initiated by any external entity. This
Modified: incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/Notifier.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/Notifier.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/Notifier.java (original)
+++ incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/Notifier.java Sat Oct 22 19:29:52 2011
@@ -63,7 +63,7 @@ package org.apache.airavata.workflow.tra
* @version $Revision: 1.6 $
* @author
*/
-public interface Notifier extends ProvenanceNotifier, PerformanceNotifier, AuditNotifier, ResourceNotifier{
+public interface Notifier extends ProvenanceNotifier, PerformanceNotifier, AuditNotifier, ResourceNotifier {
// public static final String WORKFLOW_ID = "workflow_tracking.workflow_id";
// public static final String NODE_ID = "workflow_tracking.node_id";
Modified: incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/client/Subscription.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/client/Subscription.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/client/Subscription.java (original)
+++ incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/client/Subscription.java Sat Oct 22 19:29:52 2011
@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
public class Subscription {
private static final Logger logger = LoggerFactory.getLogger(Subscription.class);
-
+
private String subscriptionID;
private String topic;
Modified: incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/common/WorkflowTrackingContext.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/common/WorkflowTrackingContext.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/common/WorkflowTrackingContext.java (original)
+++ incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/common/WorkflowTrackingContext.java Sat Oct 22 19:29:52 2011
@@ -63,6 +63,7 @@ public class WorkflowTrackingContext {
public void setBrokerEpr(EndpointReference brokerEpr) {
this.brokerEpr = brokerEpr;
}
+
public String getTopic() {
return topic;
}
@@ -70,6 +71,7 @@ public class WorkflowTrackingContext {
public void setTopic(String topic) {
this.topic = topic;
}
+
public String getPublisherImpl() {
return publisherImpl;
}
@@ -86,5 +88,4 @@ public class WorkflowTrackingContext {
this.enableAsyncPublishing = enableAsyncPublishing;
}
-
}
Modified: incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/impl/subscription/MessageBoxNotificationHandler.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/impl/subscription/MessageBoxNotificationHandler.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/impl/subscription/MessageBoxNotificationHandler.java (original)
+++ incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/impl/subscription/MessageBoxNotificationHandler.java Sat Oct 22 19:29:52 2011
@@ -172,8 +172,8 @@ public class MessageBoxNotificationHandl
} else {
if (msgBoxAddr.getAllReferenceParameters() == null)
throw new MsgBrokerClientException("Invalid Message Box EPR, no reference parameters found");
- String msgBoxId = msgBoxAddr.getAllReferenceParameters()
- .get(MsgBoxQNameConstants.MSG_BOXID_QNAME).getText();
+ String msgBoxId = msgBoxAddr.getAllReferenceParameters().get(MsgBoxQNameConstants.MSG_BOXID_QNAME)
+ .getText();
if (msgBoxId == null)
throw new MsgBrokerClientException("Invalid Message Box EPR, reference parameter MsgBoxAddr is missing");
String format = msgBoxEventSink.endsWith("/") ? "%sclientid/%s" : "%s/clientid/%s";
Modified: incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/util/XmlBeanUtils.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/util/XmlBeanUtils.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/util/XmlBeanUtils.java (original)
+++ incubator/airavata/trunk/modules/commons/workflow-tracking/src/main/java/org/apache/airavata/workflow/tracking/util/XmlBeanUtils.java Sat Oct 22 19:29:52 2011
@@ -26,7 +26,7 @@ import org.apache.xmlbeans.XmlCursor;
import org.apache.xmlbeans.XmlObject;
public class XmlBeanUtils {
-
+
public static BaseNotificationType extractBaseNotificationType(XmlObject xmldata) {
XmlCursor c = xmldata.newCursor();
c.toNextToken();
Modified: incubator/airavata/trunk/modules/commons/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/MessagePullerTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/MessagePullerTest.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/MessagePullerTest.java (original)
+++ incubator/airavata/trunk/modules/commons/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/MessagePullerTest.java Sat Oct 22 19:29:52 2011
@@ -57,7 +57,7 @@ public class MessagePullerTest extends T
public static int count = 0;
public int messages = 10;
public static Object mutex = new Object();
-
+
Subscription sub;
String AXIS_REPO;
Modified: incubator/airavata/trunk/modules/commons/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/restart/MessageBoxCreateThread.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/restart/MessageBoxCreateThread.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/restart/MessageBoxCreateThread.java (original)
+++ incubator/airavata/trunk/modules/commons/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/messagebox/restart/MessageBoxCreateThread.java Sat Oct 22 19:29:52 2011
@@ -31,7 +31,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class MessageBoxCreateThread extends Thread {
-
+
private static final Logger logger = LoggerFactory.getLogger(MessageBoxCreateThread.class);
private String brokerLocation;
private String messageboxLocation;
Modified: incubator/airavata/trunk/modules/commons/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/samples/workflow/SimpleWorkflowExecution.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/samples/workflow/SimpleWorkflowExecution.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/samples/workflow/SimpleWorkflowExecution.java (original)
+++ incubator/airavata/trunk/modules/commons/workflow-tracking/src/test/java/org/apache/airavata/workflow/tracking/tests/samples/workflow/SimpleWorkflowExecution.java Sat Oct 22 19:29:52 2011
@@ -388,7 +388,8 @@ public class SimpleWorkflowExecution ext
public void runSample() throws Exception {
notifier = NotifierFactory.createNotifier();
- WorkflowTrackingContext context = notifier.createTrackingContext(null, BROKER_URL, WORKFLOW_1, SERVICE_0, null, null);
+ WorkflowTrackingContext context = notifier.createTrackingContext(null, BROKER_URL, WORKFLOW_1, SERVICE_0, null,
+ null);
// create workflow and service instances
{
Modified: incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java (original)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java Sat Oct 22 19:29:52 2011
@@ -58,9 +58,9 @@ public class GFacService implements Serv
public static final String GFAC_URL = "GFacURL";
public static final String SECURITY_CONTEXT = "security_context";
-
+
public static final String REPOSITORY_PROPERTIES = "repository.properties";
-
+
public static final int GFAC_URL_UPDATE_INTERVAL = 1000 * 60 * 60 * 3;
/*
@@ -69,11 +69,11 @@ public class GFacService implements Serv
public static final String JCR_CLASS = "jcr.class";
public static final String JCR_USER = "jcr.user";
public static final String JCR_PASS = "jcr.pass";
-
+
/*
* Heart beat thread
*/
- private Thread thread;
+ private Thread thread;
public void startUp(ConfigurationContext configctx, AxisService service) {
AxisConfiguration config = null;
@@ -125,7 +125,7 @@ public class GFacService implements Serv
log.debug("GFAC_ADDRESS:" + localAddress);
context.setProperty(CONFIGURATION_CONTEXT_REGISTRY, registry);
context.setProperty(GFAC_URL, localAddress);
-
+
/*
* Heart beat message to registry
*/
Modified: incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/dispatchers/GFacURIBasedDispatcher.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/dispatchers/GFacURIBasedDispatcher.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/dispatchers/GFacURIBasedDispatcher.java (original)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/dispatchers/GFacURIBasedDispatcher.java Sat Oct 22 19:29:52 2011
@@ -1,4 +1,5 @@
package org.apache.airavata.services.gfac.axis2.dispatchers;
+
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -42,23 +43,22 @@ public class GFacURIBasedDispatcher exte
private static final Logger log = LoggerFactory.getLogger(GFacURIBasedDispatcher.class);
/*
- * (non-Javadoc)
+ * (non-Javadoc)
+ *
* @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
*/
public AxisService findService(MessageContext messageContext) throws AxisFault {
EndpointReference toEPR = messageContext.getTo();
if (toEPR != null) {
if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
- log.debug(messageContext.getLogIDString() +
- " Checking for Service using target endpoint address : " +
- toEPR.getAddress());
+ log.debug(messageContext.getLogIDString() + " Checking for Service using target endpoint address : "
+ + toEPR.getAddress());
}
String filePart = toEPR.getAddress();
ConfigurationContext configurationContext = messageContext.getConfigurationContext();
- String[] values = Utils.parseRequestURLForServiceAndOperation(filePart,
- messageContext.getConfigurationContext().getServiceContextPath());
- AxisConfiguration registry =
- configurationContext.getAxisConfiguration();
+ String[] values = Utils.parseRequestURLForServiceAndOperation(filePart, messageContext
+ .getConfigurationContext().getServiceContextPath());
+ AxisConfiguration registry = configurationContext.getAxisConfiguration();
if ((values.length >= 1) && (values[0] != null)) {
AxisService service = registry.getService(values[0]);
@@ -67,14 +67,14 @@ public class GFacURIBasedDispatcher exte
if (service != null) {
messageContext.setAxisService(service);
if (GFacServiceOperations.INVOKE.toString().equals(values[1])) {
- messageContext.setAxisOperation(
- service.getOperation(new QName(GFacServiceOperations.INVOKE.toString())));
+ messageContext.setAxisOperation(service.getOperation(new QName(GFacServiceOperations.INVOKE
+ .toString())));
} else if (GFacServiceOperations.GETWSDL.toString().equals(values[1])) {
- messageContext.setAxisOperation(
- service.getOperation(new QName(GFacServiceOperations.GETWSDL.toString())));
- }else if (GFacServiceOperations.GETABSTRACTWSDL.toString().equals(values[1])) {
- messageContext.setAxisOperation(
- service.getOperation(new QName(GFacServiceOperations.GETABSTRACTWSDL.toString())));
+ messageContext.setAxisOperation(service.getOperation(new QName(
+ GFacServiceOperations.GETWSDL.toString())));
+ } else if (GFacServiceOperations.GETABSTRACTWSDL.toString().equals(values[1])) {
+ messageContext.setAxisOperation(service.getOperation(new QName(
+ GFacServiceOperations.GETABSTRACTWSDL.toString())));
} else {
log.error("Wrong Service Name :" + values[0]);
}
Modified: incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java (original)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java Sat Oct 22 19:29:52 2011
@@ -126,18 +126,15 @@ public class GFacMessageReciever impleme
String serviceName = getOriginalServiceName(messageContext);
try {
/*
- * We assume that input likes <invoke>
- * <input_param_name1>value</input_param_name1>
- * <input_param_name2>value</input_param_name2>
- * <input_param_name3>value</input_param_name3> </invoke>
+ * We assume that input likes <invoke> <input_param_name1>value</input_param_name1>
+ * <input_param_name2>value</input_param_name2> <input_param_name3>value</input_param_name3> </invoke>
*/
OMElement invoke = messageContext.getEnvelope().getBody().getFirstElement();
/*
- * We assume that output likes <invokeResponse>
- * <output_param_name1>value</output_param_name1>
- * <output_param_name2>value</output_param_name2>
- * <output_param_name3>value</output_param_name3> </invokeResponse>
+ * We assume that output likes <invokeResponse> <output_param_name1>value</output_param_name1>
+ * <output_param_name2>value</output_param_name2> <output_param_name3>value</output_param_name3>
+ * </invokeResponse>
*/
OMElement output = invokeApplication(serviceName, invoke, messageContext);
@@ -192,8 +189,8 @@ public class GFacMessageReciever impleme
ServiceDescriptionType serviceDescriptionType = serviceDescription.getServiceDescriptionType();
List<org.apache.airavata.schemas.gfac.Parameter> newInputs = null;
- for (int i=0; i<serviceDescriptionType.getInputParametersArray().length; i++) {
- newInputs.add(serviceDescriptionType.getInputParametersArray(i));
+ for (int i = 0; i < serviceDescriptionType.getInputParametersArray().length; i++) {
+ newInputs.add(serviceDescriptionType.getInputParametersArray(i));
}
for (org.apache.airavata.schemas.gfac.Parameter parameter : newInputs) {
@@ -203,7 +200,8 @@ public class GFacMessageReciever impleme
throw new Exception("Parameter is not found in the message");
}
- AbstractParameter param = ParameterFactory.getInstance().createActualParameter(parameter.getType().getType().toString());
+ AbstractParameter param = ParameterFactory.getInstance().createActualParameter(
+ parameter.getType().getType().toString());
param.parseStringVal(element.getText());
inputParam.add(parameter.getName(), param);
}
@@ -214,13 +212,14 @@ public class GFacMessageReciever impleme
ParameterContextImpl outputParam = new ParameterContextImpl();
List<org.apache.airavata.schemas.gfac.Parameter> newOutputs = null;
- for (int i=0; i<serviceDescriptionType.getOutputParametersArray().length; i++) {
- newOutputs.add(serviceDescriptionType.getOutputParametersArray(i));
+ for (int i = 0; i < serviceDescriptionType.getOutputParametersArray().length; i++) {
+ newOutputs.add(serviceDescriptionType.getOutputParametersArray(i));
}
- //List<Parameter> outputs = serviceDescription.getOutputParameters();
+ // List<Parameter> outputs = serviceDescription.getOutputParameters();
for (org.apache.airavata.schemas.gfac.Parameter parameter : newOutputs) {
- outputParam.add(parameter.getName(), ParameterFactory.getInstance().createActualParameter(parameter.getType().getType().toString()));
+ outputParam.add(parameter.getName(),
+ ParameterFactory.getInstance().createActualParameter(parameter.getType().getType().toString()));
}
invocationContext.setInput(inputParam);
@@ -266,17 +265,17 @@ public class GFacMessageReciever impleme
String serviceName = getOriginalServiceName(messageContext);
String serviceEpr = gfacUrl.getAddress().split(WSConstants.GFAC_SERVICE_NAME)[0] + serviceName;
ConfigurationContext context = messageContext.getConfigurationContext();
-
+
try {
OMElement wsdlElement = getWSDL(context, serviceName);
-
- //create Concrete WSDL
+
+ // create Concrete WSDL
String cWSDL = WSDLUtil.createCWSDL(wsdlElement.toString(), serviceEpr);
SOAPFactory sf = OMAbstractFactory.getSOAP11Factory();
SOAPEnvelope responseEnv = sf.createSOAPEnvelope();
sf.createSOAPBody(responseEnv);
-
+
XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(
new StringReader(cWSDL.toString()));
StAXOMBuilder builder = new StAXOMBuilder(reader);
@@ -334,7 +333,7 @@ public class GFacMessageReciever impleme
*
* @param context
* @return
- *
+ *
*/
private Axis2Registry getRegistry(ConfigurationContext context) {
if (this.registry == null) {
@@ -352,30 +351,32 @@ public class GFacMessageReciever impleme
private String getEventBrokerURL(MessageContext context) {
SOAPHeader header = context.getEnvelope().getHeader();
- OMElement contextHeader = header.getFirstChildWithName(new QName("http://schemas.airavata.apache.org/workflow-execution-context", "context-header"));
+ OMElement contextHeader = header.getFirstChildWithName(new QName(
+ "http://schemas.airavata.apache.org/workflow-execution-context", "context-header"));
String address = null;
try {
ContextHeaderDocument document = ContextHeaderDocument.Factory.parse(contextHeader.toStringWithConsume());
address = document.getContextHeader().getWorkflowMonitoringContext().getEventPublishEpr();
} catch (XmlException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
} catch (XMLStreamException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
}
return address;
}
private String getTopic(MessageContext context) {
SOAPHeader header = context.getEnvelope().getHeader();
- OMElement contextHeader = header.getFirstChildWithName(new QName("http://schemas.airavata.apache.org/workflow-execution-context", "context-header"));
- String topic = null;
+ OMElement contextHeader = header.getFirstChildWithName(new QName(
+ "http://schemas.airavata.apache.org/workflow-execution-context", "context-header"));
+ String topic = null;
try {
ContextHeaderDocument document = ContextHeaderDocument.Factory.parse(contextHeader.toStringWithConsume());
topic = document.getContextHeader().getWorkflowMonitoringContext().getWorkflowInstanceId();
} catch (XmlException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
} catch (XMLStreamException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
}
topic = topic.substring(1);
return topic.replaceAll("_", "-");
Modified: incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/util/GFacServiceOperations.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/util/GFacServiceOperations.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/util/GFacServiceOperations.java (original)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/util/GFacServiceOperations.java Sat Oct 22 19:29:52 2011
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
package org.apache.airavata.services.gfac.axis2.util;
public enum GFacServiceOperations {
Modified: incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/util/MessageContextUtil.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/util/MessageContextUtil.java?rev=1187758&r1=1187757&r2=1187758&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/util/MessageContextUtil.java (original)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/util/MessageContextUtil.java Sat Oct 22 19:29:52 2011
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
*
-*/
+ */
package org.apache.airavata.services.gfac.axis2.util;
@@ -28,24 +28,24 @@ import org.apache.axis2.context.MessageC
public class MessageContextUtil {
-
- /**
- * Add object to Map object in message context's property. Create a new list if necessary.
- *
- * @param msgContext
- * @param propertyString
- * @param item
- */
- @SuppressWarnings({ "rawtypes", "unchecked" })
- public static synchronized void addContextToProperty(MessageContext msgContext, String propertyString, String name, Object item){
- Map<String, Object> m = null;
- if(msgContext.getProperty(propertyString) != null){
- Object obj = msgContext.getProperty(propertyString);
- m = (Map)obj;
- }else{
- m = new HashMap<String, Object>();
- }
- m.put(name, item);
- msgContext.setProperty(propertyString, m);
- }
+ /**
+ * Add object to Map object in message context's property. Create a new list if necessary.
+ *
+ * @param msgContext
+ * @param propertyString
+ * @param item
+ */
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public static synchronized void addContextToProperty(MessageContext msgContext, String propertyString, String name,
+ Object item) {
+ Map<String, Object> m = null;
+ if (msgContext.getProperty(propertyString) != null) {
+ Object obj = msgContext.getProperty(propertyString);
+ m = (Map) obj;
+ } else {
+ m = new HashMap<String, Object>();
+ }
+ m.put(name, item);
+ msgContext.setProperty(propertyString, m);
+ }
}