Examples of PName


Examples of org.objectweb.jorm.naming.api.PName

            //get the other child operand
            int j = (i+1) % 2;
            Expression other = op.getExpression(j);
            PType ptype = other.getType();
            if (ptype.getTypeCode() == PType.TYPECODE_REFERENCE) {
              PName val = null;
              try {
                val = jf.getPClassMapping(ptype.getJormName(), clazz.getClassLoader()).getPBinder().getNull();
              } catch (Exception e) {
                throw new SpeedoException(
                    "Try to replace null node. Impossible to find the null PName for the type " + ptype.getJormName(), e);
View Full Code Here

Examples of org.objectweb.jorm.naming.api.PName

    throws PException, PersistenceException {
    Object oid = id;
    if (poc != null) {
      oid = pnc.decodeAbstract(oid, poc);
    }
    PName pn = pnc.decodeAbstract(oid, tx.getConnectionHolder());
        return speedoGetObject(pn, validate);
  }
View Full Code Here

Examples of org.objectweb.jorm.naming.api.PName

                + hints + "'.");
    }

    public PName decode(PNameCoder pnc, Object oid, java.lang.Class clazz, JormFactory jf) throws PException {
        for(int i=0; i<namingManagers.length; i++) {
            PName pn = namingManagers[i].decode(pnc, oid, clazz, jf);
            if (pn != null) {
                return pn;
            }
        }
        throw new PException("No identity manager able to decode:"
View Full Code Here

Examples of org.objectweb.jorm.naming.api.PName

    public Serializable pieGetSerializedElem() throws PExceptionTyping {
        return (Serializable) element;
    }

    public PName pieGetRefElem() {
        PName pn = (PName) (element instanceof PersistentObjectItf
            ? ((PersistentObjectItf) element).getPName()
            : element);
        try {
            pn = ((PNamingContext) gca.getSpeedoPO().getPClassMapping()
                    .getPNameCoder()).export(null, pn);
View Full Code Here

Examples of org.objectweb.jorm.naming.api.PName

                } catch (PException e) {
                }
            }
            throw new NoSuchElementException();
        }
        PName pn = (PName) pnameIt.next();
        return pm.getObjectById(pn, false);
    }
View Full Code Here

Examples of org.objectweb.jorm.naming.api.PName

    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;
View Full Code Here

Examples of org.objectweb.jorm.naming.api.PName

    } else if (o instanceof PersistentObjectItf) {
            PersistentObjectItf po =(PersistentObjectItf) o;
      HomeItf h = po.speedoGetHome();
      if (h == null) {
                if (o instanceof SpeedoGenClassPO) {
                    PName pn = po.getPName();
                    if (pn == null) {
                        h = (HomeItf) ((PBinder) pn.getPNameManager()).getBinderClassMapping();
                    } else {
                        h = (HomeItf) jf.getGenClassMapping(
                                ((SpeedoGenClassPO) po).speedoGetGenClassId());
                    }
                } else {
            try {
              h = (HomeItf) jf.getPClassMapping(o.getClass());
            } catch (PException e) {
              throw new SpeedoRuntimeException(e);
                    }
        }
      }
            if (h == null) {
                logger.log(BasicLevel.WARN, "Impossible to find the home");
            }
      return h;
    } else if (o instanceof PName) {
            PName pn = (PName) o;
            PNameManager pnm = pn.getPNameManager();
            while (!(pnm instanceof PBinder)) {
                PName npn;
                try {
                    npn = pn.resolve(null);
                } catch (PException e) {
                    logger.log(BasicLevel.WARN, "Impossible to find the home from the PName " + pn, e);
                    return null;
View Full Code Here

Examples of org.objectweb.jorm.naming.api.PName

   * @return a memory instance
   */
  public Object newInstance(Object oid, ConnectionHolder context) throws PersistenceException {
    if (!(oid instanceof PName))
      throw new PersistenceException("Unmanaged object identifier: " + oid);
    PName pn = (PName) oid;
    String className = null;
    try {
      pn = pn.resolve(context);
      if (logger.isLoggable(BasicLevel.DEBUG)) {
        logger.log(BasicLevel.DEBUG, "newInstance(" + oid + "): pn.resolve=" + pn);
        logger.log(BasicLevel.DEBUG, "newInstance(" + oid + "): pn.type=" + pn.getPType());
      }
      PType type = pn.getPType();
      if (type == null) {
        //Error detected by Roland Hedayat
        throw new PersistenceException("newInstance() "
          + "\n\toid=" + oid
          + "\n\tpn=" + pn
          + "\n\tpn.pnc=" + (pn.getPNameManager() != null ? pn.getPNameManager() : null));
      }
      className = type.getJormName();
      int idx = className.indexOf(JormPathHelper.SEP);
      PClassMapping pcm = ((PBinder) pn.getPNameManager())
          .getBinderClassMapping();
      PersistentObjectItf sp = null;
      if ((pcm instanceof AbstractGenClassHome) && idx != -1) {
        // This is a Generic class
        className = getGCClassName(className.substring(0, idx));
View Full Code Here

Examples of org.objectweb.jorm.naming.api.PName

            logger.log(BasicLevel.WARN, "Error during the unbinding: ", e);
        }
  }

  public void makeBound(CacheEntry ce, Object oid) {
    PName pname = (PName) oid;
    PersistentObjectItf sp = (PersistentObjectItf) ce;
    try {
            sp.bind(pname);
        } catch (PException e) {
            logger.log(BasicLevel.WARN, "Error during the binding: ", e);
View Full Code Here

Examples of org.objectweb.jorm.naming.api.PName

  public void entryUnbound(CacheEvent event) {
      if (logger.isLoggable(BasicLevel.DEBUG)) {
          logger.log(BasicLevel.DEBUG, "Entry unbound from the cache: \n\tid: "
              + event.getCeIdentifier());
      }
      PName pn = (PName) event.getCeIdentifier();
      HomeItf sh = (HomeItf)
              ((PBinder) pn.getPNameManager()).getBinderClassMapping();
      sh.userCacheEntryUnbound(pn);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.