本文整理汇总了Java中rpc.core.UUID类的典型用法代码示例。如果您正苦于以下问题:Java UUID类的具体用法?Java UUID怎么用?Java UUID使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UUID类属于rpc.core包,在下文中一共展示了UUID类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCLSIDFromProgID
import rpc.core.UUID; //导入依赖的package包/类
public JIClsid getCLSIDFromProgID ( final String progId ) throws JIException
{
JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 2 );
callObject.addInParamAsString ( progId, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR );
callObject.addOutParamAsType ( UUID.class, JIFlags.FLAG_NULL );
try
{
Object[] result = getCOMObject ().call ( callObject );
return JIClsid.valueOf ( ( (UUID)result[0] ).toString () );
}
catch ( JIException e )
{
if ( e.getErrorCode () == 0x800401F3 )
{
return null;
}
throw e;
}
}
示例2: enumClassesOfCategories
import rpc.core.UUID; //导入依赖的package包/类
public EnumGUID enumClassesOfCategories ( final String[] implemented, final String[] required ) throws IllegalArgumentException, UnknownHostException, JIException
{
UUID[] u1 = new UUID[implemented.length];
UUID[] u2 = new UUID[required.length];
for ( int i = 0; i < implemented.length; i++ )
{
u1[i] = new UUID ( implemented[i] );
}
for ( int i = 0; i < required.length; i++ )
{
u2[i] = new UUID ( required[i] );
}
return enumClassesOfCategories ( u1, u2 );
}
示例3: next
import rpc.core.UUID; //导入依赖的package包/类
public int next ( final List<UUID> list, final int num ) throws JIException
{
if ( num <= 0 )
{
return 0;
}
JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 0 );
callObject.addInParamAsInt ( num, JIFlags.FLAG_NULL );
callObject.addInParamAsInt ( num, JIFlags.FLAG_NULL );
callObject.addOutParamAsObject ( new JIArray ( UUID.class, null, 1, true, true ), JIFlags.FLAG_NULL );
callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL );
Object[] result = Helper.callRespectSFALSE ( getCOMObject (), callObject );
UUID[] resultData = (UUID[]) ( (JIArray)result[0] ).getArrayInstance ();
Integer cnt = (Integer)result[1];
for ( int i = 0; i < cnt; i++ )
{
list.add ( resultData[i] );
}
return cnt;
}
示例4: getLibAttr
import rpc.core.UUID; //导入依赖的package包/类
public void getLibAttr() throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(4);
JIStruct tlibattr = new JIStruct();
tlibattr.addMember(UUID.class);
tlibattr.addMember(Integer.class);
tlibattr.addMember(Integer.class);
tlibattr.addMember(Short.class);
tlibattr.addMember(Short.class);
tlibattr.addMember(Short.class);
callObject.addOutParamAsObject(new JIPointer(tlibattr),JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class,JIFlags.FLAG_NULL);//CLEANUPSTORAGE
Object[] result = comObject.call(callObject);
int i = 0;
}
示例5: getConnectionInterface
import rpc.core.UUID; //导入依赖的package包/类
public String getConnectionInterface() throws JIException
{
JICallBuilder callObj = new JICallBuilder(true);
callObj.setOpnum(0);
callObj.addOutParamAsObject(new JIPointer(UUID.class, true), JIFlags.FLAG_NULL);
Object[] result = comObject.call(callObj);
return ((UUID) ((JIPointer) result[0]).getReferent()).toString();
}
示例6: listServers
import rpc.core.UUID; //导入依赖的package包/类
/**
* List all servers that match the requirements
* @param implemented All implemented categories
* @param required All required categories
* @return A collection of <q>class ids</q>
* @throws IllegalArgumentException
* @throws UnknownHostException
* @throws JIException
*/
public Collection<String> listServers ( final Category[] implemented, final Category[] required ) throws IllegalArgumentException, UnknownHostException, JIException
{
// convert the type safe categories to plain UUIDs
UUID[] u1 = new UUID[implemented.length];
UUID[] u2 = new UUID[required.length];
for ( int i = 0; i < implemented.length; i++ )
{
u1[i] = new UUID ( implemented[i].toString () );
}
for ( int i = 0; i < required.length; i++ )
{
u2[i] = new UUID ( required[i].toString () );
}
// get them as UUIDs
Collection<UUID> resultU = this._serverList.enumClassesOfCategories ( u1, u2 ).asCollection ();
// and convert to easier usable strings
Collection<String> result = new ArrayList<String> ( resultU.size () );
for ( UUID uuid : resultU )
{
result.add ( uuid.toString () );
}
return result;
}
示例7: asCollection
import rpc.core.UUID; //导入依赖的package包/类
public Collection<UUID> asCollection ( final int batchSize ) throws JIException
{
reset ();
List<UUID> data = new ArrayList<UUID> ();
int i = 0;
do
{
i = next ( data, batchSize );
} while ( i == batchSize );
return data;
}
示例8: serializeData
import rpc.core.UUID; //导入依赖的package包/类
public void serializeData(NetworkDataRepresentation ndr,Object value,List defferedPointers,int FLAG)
{
try {
((UUID)value).encode(ndr,ndr.getBuffer());
} catch (NdrException e) {
JISystem.getLogger().throwing("UUIDImpl","serializeData",e);
}
}
示例9: deserializeData
import rpc.core.UUID; //导入依赖的package包/类
public Object deserializeData(NetworkDataRepresentation ndr,List defferedPointers, Map additionalData, int FLAG)
{
UUID ret = new UUID();
try {
ret.decode(ndr,ndr.getBuffer());
} catch (NdrException e) {
JISystem.getLogger().throwing("UUIDImpl","deserializeData",e);
ret = null;
}
return ret;
}
示例10: read
import rpc.core.UUID; //导入依赖的package包/类
public void read(NetworkDataRepresentation ndr)
{
ndr.readUnsignedLong(); //pointer
ndr.readUnsignedLong(); //some length component, irrelevant for us right now
oxidBindings = JIDualStringArray.decode(ndr);
try {
UUID ipid2 = new UUID();
ipid2.decode(ndr,ndr.getBuffer());
ipid = (ipid2.toString());
} catch (NdrException e) {
JISystem.getLogger().throwing("JIRemActivation","read",e);
}
//read the auth hint
int authenticationHint = ndr.readUnsignedLong();
JIComVersion comVersion = new JIComVersion();
comVersion.setMajorVersion(ndr.readUnsignedShort());
comVersion.setMinorVersion(ndr.readUnsignedShort());
int hresult = ndr.readUnsignedLong();
if (hresult != 0)
{
//System.out.println("EXCEPTION FROM SERVER ! --> " + "0x" + Long.toHexString(hresult).substring(8));
throw new JIRuntimeException(hresult);
}
}
示例11: call
import rpc.core.UUID; //导入依赖的package包/类
public void call(int semantics, UUID object, int opnum, NdrObject ndrobj) throws IOException
{
throw new JIRuntimeException(JIErrorCodes.JI_ILLEGAL_CALL);
}
示例12: getTypeAttr
import rpc.core.UUID; //导入依赖的package包/类
public TypeAttr getTypeAttr() throws JIException
{
JICallBuilder obj = new JICallBuilder(true);
obj.setOpnum(0);
JIStruct typeAttr = new JIStruct();
JIPointer mainPtr = new JIPointer(typeAttr);
obj.addOutParamAsObject(mainPtr,JIFlags.FLAG_NULL);
//CLEANLOCALSTORAGE --> this is wrong, since CLEANLOCALSTORAGE is a struct, but it has always
//come null and even if something comes, I don't know which pointer PVOID stands for.
obj.addOutParamAsObject(new JIPointer(Integer.class),JIFlags.FLAG_NULL);
typeAttr.addMember(UUID.class);
typeAttr.addMember(Integer.class);
typeAttr.addMember(Integer.class);
typeAttr.addMember(Integer.class);
typeAttr.addMember(Integer.class);
typeAttr.addMember(new JIPointer(new JIString(null,JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR)));
typeAttr.addMember(Integer.class);
typeAttr.addMember(Integer.class);
typeAttr.addMember(Short.class);
typeAttr.addMember(Short.class);
typeAttr.addMember(Short.class);
typeAttr.addMember(Short.class);
typeAttr.addMember(Short.class);
typeAttr.addMember(Short.class);
typeAttr.addMember(Short.class);
typeAttr.addMember(Short.class);
JIStruct typeDesc = new JIStruct();
JIStruct arrayDesc = new JIStruct();
JIStruct safeArrayBounds = new JIStruct();
safeArrayBounds.addMember(Integer.class);
safeArrayBounds.addMember(Integer.class);
arrayDesc.addMember(typeDesc);
arrayDesc.addMember(Short.class);
arrayDesc.addMember(new JIArray(safeArrayBounds,new int[]{1},1,true));
JIUnion forTypeDesc = new JIUnion(Short.class);
JIPointer ptrToTypeDesc = new JIPointer(typeDesc);
JIPointer ptrToArrayDesc = new JIPointer(arrayDesc);
forTypeDesc.addMember(TypeDesc.VT_PTR,ptrToTypeDesc);
forTypeDesc.addMember(TypeDesc.VT_SAFEARRAY,ptrToTypeDesc);
forTypeDesc.addMember(TypeDesc.VT_CARRAY,ptrToArrayDesc);
forTypeDesc.addMember(TypeDesc.VT_USERDEFINED,Integer.class);
typeDesc.addMember(forTypeDesc);
typeDesc.addMember(Short.class);//VARTYPE
typeAttr.addMember(typeDesc);
JIStruct paramDesc = new JIStruct();
paramDesc.addMember(new JIPointer(JIVariant.class,false));
paramDesc.addMember(Short.class);
typeAttr.addMember(paramDesc);
Object[] result = comObject.call(obj);
TypeAttr attr = new TypeAttr((JIPointer)result[0]);
return attr;
}
示例13: getIDsOfNames
import rpc.core.UUID; //导入依赖的package包/类
public int getIDsOfNames(String apiName) throws JIException
{
if (apiName == null || apiName.trim().equals(""))
{
throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_DISP_INCORRECT_VALUE_FOR_GETIDNAMES));
}
Map innerMap = ((Map)cacheOfDispIds.get(apiName));
if (innerMap != null)
{
Integer dispId = (Integer)innerMap.get(apiName);
return dispId.intValue();
}
JICallBuilder obj = new JICallBuilder(true);
obj.setOpnum(2); //size of the array //1st is the num elements and second is the actual values
JIString name = new JIString(apiName.trim(),JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
JIArray array = new JIArray(new JIPointer[]{new JIPointer(name)},true);
obj.addInParamAsUUID(UUID.NIL_UUID,JIFlags.FLAG_NULL);
obj.addInParamAsArray(array,JIFlags.FLAG_NULL);
obj.addInParamAsInt(1,JIFlags.FLAG_NULL);
obj.addInParamAsInt(0x800,JIFlags.FLAG_NULL);
obj.addOutParamAsObject(new JIArray(Integer.class,null,1,true),JIFlags.FLAG_NULL);
Object[] result = comObject.call(obj);
if (result == null && obj.isError())
{
throw new JIException(obj.getHRESULT());
}
innerMap = new HashMap();
innerMap.put(apiName,((Object[])((JIArray)result[0]).getArrayInstance())[0]);
cacheOfDispIds.put(apiName,innerMap);
//first will be the length , and the next will be the actual value.
return ((Integer)((Object[])((JIArray)result[0]).getArrayInstance())[0]).intValue();//will get the dispatch ID.
}
示例14: _getInstantiationInfoData
import rpc.core.UUID; //导入依赖的package包/类
private JIStruct _getInstantiationInfoData()
{
/**
* typedef struct tagInstantiationInfoData {
CLSID classId;
DWORD classCtx;
DWORD actvflags;
long fIsSurrogate;
[range(1, MAX_REQUESTED_INTERFACES)]
DWORD cIID;
DWORD instFlag;
[size_is(cIID)] IID* pIID;
DWORD thisSize;
COMVERSION clientCOMVersion;
} InstantiationInfoData
* */
JIStruct struct = new JIStruct();
try {
struct.addMember(new UUID(targetClsid));
struct.addMember(new Integer(0x14));// CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_INPROC_SERVER16
struct.addMember(new Integer(0));
struct.addMember(new Integer(0));
struct.addMember(new Integer(2)); //IUnknown and IDispatch
struct.addMember(new Integer(0));
JIPointer ptr = new JIPointer(new JIArray(new UUID[]{new UUID("00000000-0000-0000-c000-000000000046"),
new UUID("00020400-0000-0000-c000-000000000046"), }, true));
ptr.setFlags(JIFlags.FLAG_REPRESENTATION_ARRAY);
struct.addMember(ptr);
//size of the current struct , why ? why ???
struct.addMember(new Integer(0));//don't know will replace later on. (remove and add)
struct.addMember(Short.valueOf((short)JISystem.getCOMVersion().getMajorVersion()));
struct.addMember(Short.valueOf((short)JISystem.getCOMVersion().getMinorVersion()));
} catch (JIException e) {
e.printStackTrace();
} //
return struct;
}
示例15: getSpecialPropertyData
import rpc.core.UUID; //导入依赖的package包/类
private JIStruct getSpecialPropertyData()
{
/**
* typedef struct tagSpecialPropertiesData {
unsigned long dwSessionId;
long fRemoteThisSessionId;
long fClientImpersonating;
long fPartitionIDPresent;
DWORD dwDefaultAuthnLvl;
GUID guidPartition;
DWORD dwPRTFlags;
DWORD dwOrigClsctx;
DWORD dwFlags;
DWORD Reserved1;
unsigned __int64 Reserved2;
DWORD Reserved3[5];
} SpecialPropertiesData;
*/
JIStruct struct = new JIStruct();
try {
struct.addMember(new Integer(0xFFFFFFFF));
struct.addMember(new Integer(0x00000000));
struct.addMember(new Integer(0x00000000));
struct.addMember(new Integer(0x00000000));
struct.addMember(new Integer(0x00000001)); //auth level none ? Why ?
struct.addMember(new UUID(UUID.NIL_UUID));
struct.addMember(new Integer(0x00000000));
struct.addMember(new Integer(0x14));
struct.addMember(new Integer(0x2));
struct.addMember(new Integer(0x00000000));
struct.addMember(new Long(0x0000000000000000));
struct.addMember(new Integer(0x00000000));
struct.addMember(new Integer(0x00000000));
struct.addMember(new Integer(0x00000000));
struct.addMember(new Integer(0x00000000));
struct.addMember(new Integer(0x00000000));
} catch (JIException e) {
e.printStackTrace();
} //
return struct;
}