Package aleph

Examples of aleph.GlobalObject


  public LoanAccount(String id) {
    this.id = id;
   
    AbstractContext context = ContextDelegator.getInstance();
    if(context.getContextId()==null)
      new GlobalObject(this, ((AbstractDistinguishable)this).getId())// publish it now 
    else
      context.newObject(this)// add it to context publish-set
  }
View Full Code Here


  public BankAccount(String id) {
    this.id = id;
   
    AbstractContext context = ContextDelegator.getInstance();
    if(context.getContextId()==null)
      new GlobalObject(this, ((AbstractDistinguishable)this).getId())// publish it now 
    else
      context.newObject(this)// add it to context publish-set
  }
View Full Code Here

    this.id = id;
    this.value = value;
   
    AbstractContext context = ContextDelegator.getInstance();
    if(context.getContextId()==null)
      new GlobalObject(this, ((AbstractDistinguishable)this).getId())// publish it now 
    else
      context.newObject(this)// add it to context publish-set
  }
View Full Code Here

  private static Map<Object, GlobalObject> registery = new ConcurrentHashMap<Object, GlobalObject>();
 
  public static boolean regsiterObject(GlobalObject globalKey){
    Object key = globalKey.getKey();
    while(true){
      GlobalObject oldGlobalKey = registery.get(key);
      if(oldGlobalKey==null)
        synchronized (registery) {
          if(registery.containsKey(key))
            continue// concurrent insert, retry
          registery.put(key, globalKey)// update the key
          break;
        }
      else
        synchronized (oldGlobalKey) {
          if(!registery.containsValue(oldGlobalKey))
            continue// the other thread retires
          oldGlobalKey = registery.get(key);
          if(oldGlobalKey.getVersion()>=globalKey.getVersion())
            return false// discard old populated messages
          registery.put(key, globalKey)// update the key
          break;
        }
    }
View Full Code Here

  }
  public Object open (Object key, String mode){
    return open (ContextDelegator.getInstance(), key, mode);
  }
  public Object open (AbstractContext context, Object key, String mode){
    GlobalObject globalKey = ObjectsRegistery.getKey(key);
    if(globalKey==null){
      Logger.debug("Key not found!! " + key);
//      ObjectsRegistery.dump();
//      Logger.info("[" + ObjectsRegistery.getKey(key) + "]");
      throw new NotRegisteredKeyException(key);
View Full Code Here

      throw e;
    }
     return object;
  }
  public Object open (AbstractContext context, Object key, String mode, Timespec deadline, Timespec period_ts, int tid) throws InterruptedException{
    GlobalObject globalKey = ObjectsRegistery.getKey(key);
    if(globalKey==null){
      Logger.debug("Key not found!! " + key);
//      ObjectsRegistery.dump();
//      Logger.info("[" + ObjectsRegistery.getKey(key) + "]");
      throw new NotRegisteredKeyException(key);
View Full Code Here

  public void wakeupWaitingTask(Object key, Timespec deadline, Timespec period_ts, int tid) {
    wakeupWaitingTask (ContextDelegator.getInstance(), key, deadline, period_ts, tid);
  }

  public void wakeupWaitingTask(AbstractContext context, Object key, Timespec deadline, Timespec period_ts, int tid) {
    GlobalObject globalKey = ObjectsRegistery.getKey(key);
    if(globalKey==null){
      Logger.debug("Key not found!! " + key);
      throw new NotRegisteredKeyException(key);
    }
    Logger.debug("Key found " + key);
View Full Code Here

    HyFlow.getConflictManager().open(context);
    return;
  }
  public Object open (AbstractContext context, Object key, String mode, boolean proxyFlag ){
    GlobalObject globalKey = ObjectsRegistery.getKey(key);
    if(globalKey==null){
      Logger.debug("Key not found!! " + key);
//      ObjectsRegistery.dump();
//      Logger.info("[" + ObjectsRegistery.getKey(key) + "]");
      throw new NotRegisteredKeyException(key);
View Full Code Here


  public void unregister(AbstractDistinguishable object){
  }
  public void register(AbstractDistinguishable object) {
    new GlobalObject(object, object.getId())// publish it now
  }
View Full Code Here

    this.total = INITIAL;
    this.used = 0;
   
    AbstractContext context = ContextDelegator.getInstance();
    if(context.getContextId()==null)
      new GlobalObject(this, ((AbstractDistinguishable)this).getId())// publish it now 
    else
      context.newObject(this)// add it to context publish-set
  }
View Full Code Here

TOP

Related Classes of aleph.GlobalObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.