Ejemplo n.º 1
0
  public static Delegator getDelegator(String delegatorName) {
    if (delegatorName == null) {
      delegatorName = "default";
      // Debug.logWarning(new Exception("Location where getting delegator with null name"), "Got a
      // getGenericDelegator call with a null delegatorName, assuming default for the name.",
      // module);
    }
    do {
      Delegator delegator = delegatorCache.get(delegatorName);

      if (delegator != null) {
        // setup the Entity ECA Handler
        delegator.initEntityEcaHandler();
        // Debug.logInfo("got delegator(" + delegatorName + ") from cache", module);

        // setup the distributed CacheClear
        delegator.initDistributedCacheClear();

        return delegator;
      }
      try {
        delegator = UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName);
      } catch (ClassNotFoundException e) {
        Debug.logError(e, module);
      }
      // Debug.logInfo("putting delegator(" + delegatorName + ") into cache", module);
      delegatorCache.putIfAbsent(delegatorName, delegator);
    } while (true);
  }
Ejemplo n.º 2
0
 public Object deserialize(RecordManager recman, long recid, byte[] bytes) throws IOException {
   return UtilObject.getObject(bytes);
 }
Ejemplo n.º 3
0
 public Object deserialize(byte[] bytes) throws IOException {
   return UtilObject.getObject(bytes);
 }
Ejemplo n.º 4
0
 public byte[] serialize(RecordManager recman, long recid, Object o) throws IOException {
   return UtilObject.getBytes(o);
 }
Ejemplo n.º 5
0
 public byte[] serialize(Object o) throws IOException {
   return UtilObject.getBytes(o);
 }
 public Object getExternalRequester() {
   byte[] value = process.getBytes(org.ofbiz.shark.SharkConstants.externalReq);
   return UtilObject.getObject(value);
 }
 public void setExternalRequester(Object o) {
   byte[] value = UtilObject.getBytes(o);
   process.setBytes(org.ofbiz.shark.SharkConstants.externalReq, (value != null ? value : null));
 }