Search in sources :

Example 1 with RemoteObject

use of org.jbpm.services.ejb.remote.api.RemoteObject in project jbpm by kiegroup.

the class RemoteObjectProcessor method processRemoteObjects.

@SuppressWarnings("unchecked")
public static <T> T processRemoteObjects(T variables, ClassLoader cl) {
    if (variables instanceof RemoteMap) {
        RemoteMap remoteMap = ((RemoteMap) variables);
        remoteMap.setClassLoader(cl);
        Map<String, Object> data = new HashMap<String, Object>();
        for (String key : remoteMap.keySet()) {
            data.put(key, remoteMap.get(key));
        }
        return (T) data;
    } else if (variables instanceof RemoteObject) {
        ((RemoteObject) variables).setClassLoader(cl);
        return (T) ((RemoteObject) variables).get();
    }
    return null;
}
Also used : RemoteMap(org.jbpm.services.ejb.remote.api.RemoteMap) RemoteObject(org.jbpm.services.ejb.remote.api.RemoteObject) HashMap(java.util.HashMap) RemoteObject(org.jbpm.services.ejb.remote.api.RemoteObject)

Aggregations

HashMap (java.util.HashMap)1 RemoteMap (org.jbpm.services.ejb.remote.api.RemoteMap)1 RemoteObject (org.jbpm.services.ejb.remote.api.RemoteObject)1