本文整理了Java中org.jboss.util.id.GUID
类的一些代码示例,展示了GUID
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GUID
类的具体详情如下:
包路径:org.jboss.util.id.GUID
类名称:GUID
[英]A globally unique identifier (globally across a cluster of virtual machines).
The identifier is composed of:
[ address ] - [ process id ] - [ time ] - [ counter ] - [ time ] - [ counter ]
|------- UID --------| |------- UID --------|
|---------------------- VMID -----------------------|
[中]全局唯一标识符(在虚拟机集群中全局)。
标识符由以下部分组成:
1.虚拟机的VMID。
1.在VMID上提供唯一性的UID。
[ address ] - [ process id ] - [ time ] - [ counter ] - [ time ] - [ counter ]
|------- UID --------| |------- UID --------|
|---------------------- VMID -----------------------|
代码示例来源:origin: org.jboss.microcontainer/jboss-deployers-impl
public URL getDynamicClassRoot()
{
if (dynamicClassRoot == null)
{
try
{
dynamicClassRoot = new URL("vfsmemory://" + new GUID());
}
catch (MalformedURLException e)
{
throw new RuntimeException(e);
}
}
return dynamicClassRoot;
}
}
代码示例来源:origin: org.jboss.jbossas/jboss-as-aspects
public boolean equals(Object obj)
{
if (!(obj instanceof DistributedPOJOState)) return false;
DistributedPOJOState pojo = (DistributedPOJOState)obj;
return guid.equals(pojo.guid);
}
代码示例来源:origin: org.jboss/jboss-common-core
/**
* Returns a GUID as a string.
*
* @return GUID as a string.
*/
public static String asString() {
return new GUID().toString();
}
代码示例来源:origin: org.jboss/jboss-common-core
public int compareTo(Object o)
{
GUID guid = (GUID)o;
return this.toString().compareTo(guid.toString());
}
代码示例来源:origin: org.jboss.jbossas/jboss-as-aspects
public int hashCode()
{
return guid.hashCode();
}
代码示例来源:origin: org.jboss.deployers/jboss-deployers-vfs
/**
* Create host name.
*
* @param unit the deployment unit
* @return the host name
*/
protected String createHost(VFSDeploymentUnit unit)
{
return (hostNameCreator != null) ? hostNameCreator.createHostName(unit) : GUID.asString();
}
代码示例来源:origin: org.jboss.aop/jboss-aop
public static Proxy createInterfaceProxy(ClassLoader loader, Class<?>[] interfaces, ProxyMixin[] mixins, InstanceAdvisor advisor) throws Exception
{
Class<?> clazz = createProxyClass(loader, mixins, interfaces);
Proxy instance = (Proxy) clazz.newInstance();
instance.instanceAdvisor = advisor;
instance.mixins = mixins;
instance.interfaces = interfaces;
instance.guid = new GUID();
synchronized (proxyCache)
{
proxyCache.put(instance.guid, clazz);
}
return instance;
}
代码示例来源:origin: jboss.remoting/jboss-remoting
private String generateListenerId(InvokerCallbackHandler callbackhandler)
{
String listenerId = null;
Object obj = listeners.get(callbackhandler);
if(obj == null)
{
listenerId = new GUID().toString();
listeners.put(callbackhandler, listenerId);
}
return listenerId;
}
代码示例来源:origin: org.jboss.jbossas/jboss-as-server
/**
* Returns wether we are local to the originating container or not.
*
* @return true when we have the same GUID
*/
public boolean isLocal()
{
return invokerID.equals(Invoker.ID);
}
代码示例来源:origin: org.jboss.aop/jboss-aop
public static GUID generateProxyClass(ClassLoader loader, ProxyMixin[] mixins, Class<?>[] interfaces) throws Exception
{
Class<?> clazz = createProxyClass(loader, mixins, interfaces);
GUID guid = new GUID();
synchronized (proxyCache)
{
proxyCache.put(guid, clazz);
}
return guid;
}
代码示例来源:origin: jboss.remoting/jboss-remoting
/**
* Constructs a remoting client with intended target server specified via the locator and
* intended subsystem on server for invocations to be routed to.
*
* @deprecated This constructor should not be used any more as will no longer take into account
* the classloader specified as a parameter.
*/
public Client(ClassLoader cl, ClientInvoker invoker, String subsystem) throws Exception
{
this.classloader = cl;
this.subsystem = subsystem == null ? null : subsystem.toUpperCase();
this.invoker = invoker;
this.sessionId = new GUID().toString();
}
代码示例来源:origin: org.jboss.aop/jboss-aop
private boolean isLocal()
{
return key.getGuid().equals(GUID);
}
代码示例来源:origin: jboss.remoting/jboss-remoting
public Object invoke(InvocationRequest invocation) throws Throwable
{
String command = (String) invocation.getParameter();
System.out.println("command: " + command);
Callback cb = new Callback("callback " + ++counter);
// Register as listener and pass callback id.
HashMap returnPayload = new HashMap();
returnPayload.put(ServerInvokerCallbackHandler.CALLBACK_LISTENER, this);
returnPayload.put(ServerInvokerCallbackHandler.CALLBACK_ID, new GUID());
cb.setReturnPayload(returnPayload);
if (REMOTING_ACKNOWLDEGEMENTS.equals(command))
{
returnPayload.put(ServerInvokerCallbackHandler.REMOTING_ACKNOWLEDGES_PUSH_CALLBACKS, "true");
}
callbackHandler.handleCallback(cb);
return null;
}
代码示例来源:origin: jboss.remoting/jboss-remoting
/**
* Constructs a remoting client with intended target server specified via the locator, intended
* subsystem on the server for invocations to be routed to, and configuration metadata. The
* metadata supplied will be used when creating client invoker (in the case specific data is
* required) and also for passing along additional data to connection listeners on the server
* side in the case that the client fails, will be able to use this extra information when
* notified (which will happen when connect() method is called.
*
* @param cl - the classloader that should be used by remoting.
* @deprecated This constructor should not be used any more as will no longer take into account
* the classloader specified as a parameter.
*/
public Client(ClassLoader cl, InvokerLocator locator, String subsystem, Map configuration)
throws Exception
{
this.classloader = cl;
this.locator = locator;
this.subsystem = subsystem == null ? null : subsystem.toUpperCase();
if (configuration != null)
{
this.configuration = new HashMap(configuration);
}
this.sessionId = new GUID().toString();
processParameters();
}
代码示例来源:origin: org.jboss.aop/jboss-aop
if(!guid.equals(other.guid))
代码示例来源:origin: stackoverflow.com
int uploadBufferLength = BUFFER_DEFAULT_LENGTH;
String CRLF = "\r\n";
String boundary = (new GUID()).toString();
代码示例来源:origin: jboss.remoting/jboss-remoting
listenerId = new GUID().toString();
String key = listenerId;
if (sessionId != null)
代码示例来源:origin: org.jboss.jbossas/jboss-as-aspects
clusterUpdates.add(manager.createTxUpdate(tx));
globalTxId = new GUID();
acquireRemoteLocks(globalTxId, guidList);
代码示例来源:origin: org.jboss.jbossas/jboss-as-aspects
public GUID tag(InstanceAdvised advised)
{
GUID guid = new GUID();
org.jboss.aop.metadata.SimpleMetaData metaData = advised._getInstanceAdvisor().getMetaData();
metaData.addMetaData(VERSION_MANAGER, VERSION_ID, guid);
return guid;
}
代码示例来源:origin: org.jboss.ejb3/jboss-ejb3-core
/**
* A brand new stateful session bean.
*
* @param container
* @param bean
*/
protected StatefulBeanContext(StatefulContainer container, Object bean)
{
super(container, bean);
this.containerClusterUid = Ejb3Registry.clusterUid(container);
this.containerGuid = Ejb3Registry.guid(container);
this.isClustered = container.isClustered();
this.id = new GUID();
}
内容来源于网络,如有侵权,请联系作者删除!