/** * @return A {@link UID}. */ public Object createId(StatefulSessionEnterpriseContext ctx) throws Exception { return new UID(); }
/** * Return a string representation of this GUID. * * @return A string representation of this GUID. */ public String toString() { // JBCOMMON-88. Cache this as it's expensive to create if (toString == null) { toString = vmid.toString() + "-" + uid.toString(); } return toString; }
/** * Check if the given object is equal to this GUID. * * <p>A GUID is equal to another GUID if the VMID and UID portions are * equal. * * @param obj Object to test equality with. * @return True if object is equal to this GUID. */ public boolean equals(final Object obj) { if (obj == this) return true; if (obj != null && obj.getClass() == getClass()) { GUID guid = (GUID)obj; return guid.vmid.equals(vmid) && guid.uid.equals(uid); } return false; }
/** * Construct a new VMID. * * @param address The address of the current virtual machine. * @param pid Process identifier. * @param uid Unique identifier. * * @see #getInstance() For getting a VMID instance reference. */ protected VMID(final byte[] address, final PID pid, final UID uid) { this.address = address; this.pid = pid; this.uid = uid; // generate a hashCode for this VMID int code = pid.hashCode(); code ^= uid.hashCode(); code ^= HashCode.generate(address); hashCode = code; }
/** * Check if the given object is equal to this VMID. * * <p>A VMID is equals to another VMID if the address, * process identifer and UID portions are equal. * * @param obj Object to test equality with. * @return True if object is equals to this VMID. */ public boolean equals(final Object obj) { if (obj == this) return true; if (obj != null && obj.getClass() == getClass()) { VMID vmid = (VMID)obj; return Arrays.equals(vmid.address, address) && vmid.pid.equals(pid) && vmid.uid.equals(uid); } return false; }
public Object createId(StatefulSessionEnterpriseContext ctx) throws Exception { // // jason: could probably use org.jboss.util.collection.CompoundKey here // for better uniqueness based on hashCode and such... // // return new CompoundKey(this.localNodeName, new UID()); // return this.localNodeName + ":" + new UID(); }
@Override public ObjectName getID() { if (id == null) { StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":"); str.append("type=SupportingElement,id=" + new UID()); id = ObjectNameFactory.create(str.toString()); } return id; } }
@Override public ObjectName getID() { if (id == null) { StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":"); str.append("type=StartEvent,name=" + getName() + ",id=" + new UID()); id = ObjectNameFactory.create(str.toString()); } return id; }
/** * Create the VMID for the current virtual mahcine. * * @return Virtual machine identifer. */ private static VMID create() { // get the local internet address for the current host byte[] address = getHostAddress(); return new VMID(address, PID.getInstance(), new UID()); } }
@Override public ObjectName getID() { if (id == null) { StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":"); str.append("type=EndEvent,name=" + getName() + ",id=" + new UID()); id = ObjectNameFactory.create(str.toString()); } return id; }
@Override public ObjectName getID() { if (id == null) { StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":"); str.append("type=SubProcess,name=" + getName() + ",id=" + new UID()); id = ObjectNameFactory.create(str.toString()); } return id; }
@Override public ObjectName getID() { if (id == null) { StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":"); str.append("type=IntermediateEvent,name=" + getName() + ",id=" + new UID()); id = ObjectNameFactory.create(str.toString()); } return id; }
@Override public ObjectName getID() { if (id == null) { StringBuilder str = new StringBuilder(Constants.ID_DOMAIN + ":"); str.append("type=Process,name=" + getName() + ",id=" + new UID()); id = ObjectNameFactory.create(str.toString()); } return id; }
public ObjectName getID() { if (id == null) { StringBuilder str = new StringBuilder("org.jbpm:"); str.append("type=Process,name=" + getName() + ",id=" + new UID()); id = ObjectNameFactory.create(str.toString()); } return id; }
public ObjectName getID() { if (id == null) { StringBuilder str = new StringBuilder("org.jbpm:"); str.append("type=Other,name=" + getName() + ",id=" + new UID()); id = ObjectNameFactory.create(str.toString()); } return id; }