Package java.rmi.server

Examples of java.rmi.server.UID


   * @deprecated use generateUid instead
   * @return unique id
   */
  public static String generateUidOld()
  {
    UID uniqueId = new UID();
    InetAddress host = null;
    try
    {
      host = InetAddress.getLocalHost();
    }
    catch (UnknownHostException e)
    {
      e.printStackTrace();
    }
    String id;
    if (host == null)
    {
      id = uniqueId.toString() + Math.random();
      System.out.println("Generated id: " + id + " len: " + id.length());
      return id;
    }
    else
    {
      id = host.getHostAddress() + ":" + uniqueId.toString() + Math.random();
      System.out.println("Generated id: " + id + " len: " + id.length());
      return id;
    }
  }
View Full Code Here


        if (!(body instanceof Entry)) {
            entry = new InEntry();

            if (body instanceof BeanInvocation) {
                ((InEntry) entry).correlationId = (new UID()).toString();
            }

            if (body instanceof byte[]) {
                ((InEntry) entry).binary = true;
                ((InEntry) entry).buffer = (byte[]) body;
View Full Code Here

        if (!(body instanceof Entry)) {
            entry = new InEntry();

            if (body instanceof BeanInvocation) {
                ((InEntry) entry).correlationId = (new UID()).toString();
            }

            if (body instanceof byte[]) {
                ((InEntry) entry).binary = true;
                ((InEntry) entry).buffer = (byte[]) body;
View Full Code Here

  }

  private Xid createXid() throws IOException {
    ByteArrayOutputStream gtridOut = new ByteArrayOutputStream();
    DataOutputStream dataOut = new DataOutputStream(gtridOut);
    new UID().write(dataOut);
   
    final byte[] gtrid = gtridOut.toByteArray();
   
    ByteArrayOutputStream bqualOut = new ByteArrayOutputStream();
    dataOut = new DataOutputStream(bqualOut);
   
    new UID().write(dataOut);
   
    final byte[] bqual = bqualOut.toByteArray();
   
    Xid xid = new MysqlXid(gtrid, bqual, 3306);
    return xid;
View Full Code Here

  private Xid createXid(Xid xidToBranch) throws IOException {
    ByteArrayOutputStream bqualOut = new ByteArrayOutputStream();
    DataOutputStream dataOut = new DataOutputStream(bqualOut);
   
    new UID().write(dataOut);
   
    final byte[] bqual = bqualOut.toByteArray();
   
    Xid xid = new MysqlXid(xidToBranch.getGlobalTransactionId(), bqual, 3306);
   
View Full Code Here

   
    protected String autoGenerateID(PortletDefinition pd)
    {
        String appName = ((MutablePortletApplication)pd.getPortletApplicationDefinition()).getName();
        String portletName = pd.getName();
        return appName+"::"+portletName+"::"+new UID().toString();
    }
View Full Code Here

  private static byte[] generateSync() {
    try {
      MessageDigest digester = MessageDigest.getInstance("MD5");
      long time = System.currentTimeMillis();
      digester.update((new UID()+"@"+time).getBytes());
      return digester.digest();
    } catch (NoSuchAlgorithmException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

        ourUUIDStateSeqNum = randomGen.nextLong() & 0x0FFFFL;
        getRandomInfo(ourUUIDStateNode);
    }

    private static void getRandomInfo(byte[] node) throws SVNException {
        UID uid = new UID();
        MessageDigest digest = null;
        try {
            digest = MessageDigest.getInstance("MD5");
        } catch (NoSuchAlgorithmException e) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "MD5 implementation not found: {0}", e.getLocalizedMessage());
            SVNErrorManager.error(err, e, SVNLogType.DEFAULT);
        }
        digest.update(uid.toString().getBytes());
        byte[] seed = digest.digest();
        int numToCopy = node.length < seed.length ? node.length : seed.length;
        System.arraycopy(seed, 0, node, 0, numToCopy);
        node[0] |= 0x01;
    }
View Full Code Here

               "Instead using host based UID strategy for defining a node " +
               "GUID for the cluster.");

      // 2nd: host-GUID strategy
      //
      String uid = new UID().toString();
      return hostIP + ":" + uid;
   }
View Full Code Here

    */
   public String put(ImageWrapper image, String key)
   {
      if (key == null)
      {
         key = "org.jboss.seam.ui.GraphicImageStore." + new UID().toString().replace(":", "-");
      }
      store.put(key, image);
      setDirty();
      log.debug("Put image into to session with key #0", key);
      return key;
View Full Code Here

TOP

Related Classes of java.rmi.server.UID

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.