Package org.objectweb.jorm.facility.naming.rdbsequence

Examples of org.objectweb.jorm.facility.naming.rdbsequence.RdbSequencePName


    if (en instanceof PName) {
      //Naming context role
      if (((PName) en).getPNameManager() == this) {
        return (PName) en;
      } else {
        return new RdbSequencePName(this, en);
      }
    }

    //Binder role
    PBindingCtrl pb = (PBindingCtrl) en;
    byte nextstate = PStateGraph.nextStatePBinding(pb.getStatus(),
                             PBinding.ACTION_EXPORT);
    if (nextstate == PBinding.LIFECYCLE_ERROR)
      throw new PExceptionProtocol("Unauthorized operation");

    PName pn = null;
    boolean connectionAllocatedLocaly = false;
    try {
      if (c == null) {
        c = getBinderClassMapping().getPMapper().getConnection();
        connectionAllocatedLocaly = true;
      }
      initSequenceHelper();
      long lid = ((Long) sequence.next()).longValue();
      //TODO : if factory, lid = factory.next
      pn = new RdbSequencePName(this, new Long(lid));
    } finally {
      if (connectionAllocatedLocaly) {
        getBinderClassMapping().getPMapper().closeConnection(c);
      } else if (c instanceof ConnectionHolder) {
        try {
View Full Code Here

TOP

Related Classes of org.objectweb.jorm.facility.naming.rdbsequence.RdbSequencePName

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.