当前位置: 首页>>代码示例>>Java>>正文


Java JISystem.getLocalizedMessage方法代码示例

本文整理汇总了Java中org.jinterop.dcom.common.JISystem.getLocalizedMessage方法的典型用法代码示例。如果您正苦于以下问题:Java JISystem.getLocalizedMessage方法的具体用法?Java JISystem.getLocalizedMessage怎么用?Java JISystem.getLocalizedMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jinterop.dcom.common.JISystem的用法示例。


在下文中一共展示了JISystem.getLocalizedMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDllEntry

import org.jinterop.dcom.common.JISystem; //导入方法依赖的package包/类
public Object[] getDllEntry(int memberId, int invKind) throws JIException
{
	if (invKind != InvokeKind.INVOKE_FUNC.intValue() && invKind != InvokeKind.INVOKE_PROPERTYGET.intValue()
			&& invKind != InvokeKind.INVOKE_PROPERTYPUTREF.intValue() && invKind != InvokeKind.INVOKE_PROPERTYPUT.intValue())
	{
		throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.E_INVALIDARG));
	}

	JICallBuilder callObject = new JICallBuilder(true);
	callObject.addInParamAsInt(memberId,JIFlags.FLAG_NULL);
	callObject.addInParamAsInt(invKind,JIFlags.FLAG_NULL);
	callObject.addInParamAsInt(1,JIFlags.FLAG_NULL);//refPtrFlags , as per the oaidl.idl...
	callObject.addOutParamAsObject(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_BSTR),JIFlags.FLAG_NULL);
	callObject.addOutParamAsObject(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_BSTR),JIFlags.FLAG_NULL);
	callObject.addOutParamAsObject(Short.class,JIFlags.FLAG_NULL);
	callObject.setOpnum(10);
	return comObject.call(callObject);
}
 
开发者ID:howie,项目名称:jinterop,代码行数:19,代码来源:JITypeInfoImpl.java

示例2: addMethodDescriptor

import org.jinterop.dcom.common.JISystem; //导入方法依赖的package包/类
/**Adds a Method Descriptor. Methods <b>must</b> be added in the same order as they appear in the IDL.
 *
 * <p> Please note that overloaded methods are not allowed.
 * @param methodDescriptor
 * @throws IllegalArgumentException if a method by the same name already exists.
 */
public void addMethodDescriptor(JILocalMethodDescriptor methodDescriptor)
{
	if (nameVsMethodInfo.containsKey(methodDescriptor.getMethodName()))
	{
		throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_CALLBACK_OVERLOADS_NOTALLOWED));
	}

	methodDescriptor.setMethodNum(nextNum);
	nextNum++;

	opnumVsMethodInfo.put(new Integer(methodDescriptor.getMethodNum()),methodDescriptor);
	if (dispInterface)
	{
		if (methodDescriptor.getMethodDispID() == -1)
		{
			throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_METHODDESC_DISPID_MISSING));
		}
		dispIdVsMethodInfo.put(new Integer(methodDescriptor.getMethodDispID()),methodDescriptor);
	}

	nameVsMethodInfo.put(methodDescriptor.getMethodName(),methodDescriptor);


}
 
开发者ID:howie,项目名称:jinterop,代码行数:31,代码来源:JILocalInterfaceDefinition.java

示例3: addMember

import org.jinterop.dcom.common.JISystem; //导入方法依赖的package包/类
/** Adds a member to this Union. The <code>member</code> is distinguished using the <code>discriminant</code>. <br>
 *
 * @param discriminant
 * @param member
 * @throws JIException
 * @throws IllegalArgumentException if <code>discriminant</code> is <code>null</code>
 */
//used both for reading and writing
public void addMember(Object discriminant, JIStruct member) throws JIException
{
	if (discriminant == null)
	{
		throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_UNION_NULL_DISCRMINANT));
	}

	if (!discriminant.getClass().equals(discriminantClass))
	{
		throw new JIException(JIErrorCodes.JI_UNION_DISCRMINANT_MISMATCH);
	}

	if (member == null)
	{
		member = JIStruct.MEMBER_IS_EMPTY;
	}

	dsVsMember.put(discriminant,member);
	//do not need a seperate list of pointers like the struct , since based on the discriminant only 1 pointer
	//(if present) can be deserialized\serialized.
	}
 
开发者ID:howie,项目名称:jinterop,代码行数:30,代码来源:JIUnion.java

示例4: JIString

import org.jinterop.dcom.common.JISystem; //导入方法依赖的package包/类
/** Creates a string object of a given <code>type</code>.
 *
 * @param str value encapsulated by this object.
 * @param type JIFlags string flags
 * @see JIFlags#FLAG_REPRESENTATION_STRING_BSTR
 * @see JIFlags#FLAG_REPRESENTATION_STRING_LPCTSTR
 * @see JIFlags#FLAG_REPRESENTATION_STRING_LPWSTR
 * @throws IllegalArgumentException if <code>type</code> is not a string flag.
 */
public JIString(String str, int type)
{
	str = (str == null) ? "" : str;
	this.type = type;
	if (type == JIFlags.FLAG_REPRESENTATION_STRING_LPCTSTR || type == JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR)
	{
		member = new JIPointer(str,true);
		Variant = null;
		VariantByRef = null;
	}
	else if (type == JIFlags.FLAG_REPRESENTATION_STRING_BSTR)
	{
		member = new JIPointer(str,false);
		member.setReferent(0x72657355);//"User" in LEndian.
		Variant = new JIVariant(this);
		VariantByRef = new JIVariant(this,true);
	}
	else
	{
		throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_UTIL_FLAG_ERROR));
	}

	member.setFlags(type | JIFlags.FLAG_REPRESENTATION_VALID_STRING);

}
 
开发者ID:howie,项目名称:jinterop,代码行数:35,代码来源:JIString.java

示例5: createSession

import org.jinterop.dcom.common.JISystem; //导入方法依赖的package包/类
/** Creates a session with the <code>authInfo</code> of the user. This session is not yet attached to a
 * COM server.
 *
 * @param authInfo
 * @return
 * @throws IllegalArgumentException if <code>authInfo</code> is <code>null</code>.
 * @see JIComServer#JIComServer(JIClsid, JISession)
 * @see JIComServer#JIComServer(JIProgId, JISession)
 */
public static JISession createSession(IJIAuthInfo authInfo)
{
	if (authInfo == null)
	{
		throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_AUTH_NOT_SUPPLIED));
	}

	JISession session = new JISession();

	session.authInfo = authInfo;

	session.sessionIdentifier = authInfo.getUserName().hashCode() ^ authInfo.getPassword().hashCode() ^ authInfo.getDomain().hashCode() ^ new Object().hashCode() ^ (int)Runtime.getRuntime().freeMemory() ^ randomGen.nextInt();


	synchronized (mutex) {
		mapOfSessionIdsVsSessions.put(new Integer(session.sessionIdentifier),session);
		listOfSessions.add(session);
	}

	if (JISystem.getLogger().isLoggable(Level.INFO))
	{
		JISystem.getLogger().info("Created Session: " + session.sessionIdentifier);
	}
	return session;
}
 
开发者ID:howie,项目名称:jinterop,代码行数:35,代码来源:JISession.java

示例6: instantiateComObject

import org.jinterop.dcom.common.JISystem; //导入方法依赖的package包/类
/** Typically used in the Man-In-The-Middle scenario, where one j-Interop system interacts with another over the wire.
   * Or the IJIComObject is deserialized from a Database and is right now drifting.
   *
   * @exclude
   * @param session
   * @param comObject
   * @return
   * @throws JIException
   */
  public static IJIComObject instantiateComObject(JISession session,IJIComObject comObject) throws JIException
  {
  	if (comObject.getAssociatedSession() != null)
{
	throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_SESSION_ALREADY_ATTACHED));
}

  	if (comObject.isLocalReference())
  	{
  		throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_COMOBJ_LOCAL_REF));
  	}

  	return instantiateComObject(session, comObject.internal_getInterfacePointer());
  }
 
开发者ID:howie,项目名称:jinterop,代码行数:24,代码来源:JIFrameworkHelper.java

示例7: addInterfaceDefinition

import org.jinterop.dcom.common.JISystem; //导入方法依赖的package包/类
/** Add another interface definition and it's class. Make sure that this class has a default constructor,
 * so that instantiation using <i>reflection</i> can take place.
 *
 * @param interfaceDefinition implementing structurally the definition of the COM callback interface.
 * @param clazz instance for serving requests from COM client. Must implement
 * the <code>interfaceDefinition</code> fully.
 * @throws IllegalArgumentException if <code>interfaceDefinition</code> or <code>clazz</code> are <code>null</code>.
 */
public void addInterfaceDefinition(JILocalInterfaceDefinition interfaceDefinition, Class clazz )
{
	if (interfaceDefinition == null || clazz == null)
	{
		throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_COM_RUNTIME_INVALID_CONTAINER_INFO));
	}
	interfaceDefinition.clazz = clazz;
	String s = interfaceDefinition.getInterfaceIdentifier().toUpperCase();
	listOfSupportedInterfaces.add(s);
	listOfSupportedEventInterfaces.add(s);
	mapOfIIDsToInterfaceDefinitions.put(s,interfaceDefinition);
}
 
开发者ID:howie,项目名称:jinterop,代码行数:21,代码来源:JILocalCoClass.java

示例8: JILocalCoClass

import org.jinterop.dcom.common.JISystem; //导入方法依赖的package包/类
/**Creates a local class instance.
 *
 * @param interfaceDefinition implementing structurally the definition of the COM callback interface.
 * @param instance instance for serving requests from COM client. Must implement
 * the <code>interfaceDefinition</code> fully.
 * @throws IllegalArgumentException if <code>interfaceDefinition</code> or <code>instance</code> are <code>null</code>.
 */
public JILocalCoClass(JILocalInterfaceDefinition interfaceDefinition,Object instance)
{
	if (interfaceDefinition == null || instance == null)
	{
		throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_COM_RUNTIME_INVALID_CONTAINER_INFO));
	}
	this.identifier = instance.hashCode() ^ new Object().hashCode() ^ randomGen.nextInt();
	init(interfaceDefinition,null,instance,false);
}
 
开发者ID:howie,项目名称:jinterop,代码行数:17,代码来源:JILocalCoClass.java

示例9: checkIfCalled

import org.jinterop.dcom.common.JISystem; //导入方法依赖的package包/类
private void checkIfCalled()
{
	if (!executed)
	{
		throw new IllegalStateException(JISystem.getLocalizedMessage(JIErrorCodes.JI_API_INCORRECTLY_CALLED));
	}
}
 
开发者ID:howie,项目名称:jinterop,代码行数:8,代码来源:JICallBuilder.java

示例10: JIUnsignedShort

import org.jinterop.dcom.common.JISystem; //导入方法依赖的package包/类
JIUnsignedShort(Integer shortValue)
{
	if (shortValue == null || shortValue.intValue() < 0)
	{
		throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_UNSIGNED_NEGATIVE));
	}
	this.shortValue = shortValue;
}
 
开发者ID:howie,项目名称:jinterop,代码行数:9,代码来源:JIUnsignedShort.java

示例11: JIComServer

import org.jinterop.dcom.common.JISystem; //导入方法依赖的package包/类
/**<p>Refer {@link #JIComServer(JIProgId, JISession)} for details.
 *
 * @param progId user-friendly string such as "Excel.Application" , "TestCOMServer.Test123" etc.
 * @param address address of the host where the <code>COM</code> object resides.This should be in the IEEE IP format (e.g. 192.168.170.6) or a resolvable HostName.
 * @param session session to be associated with.
 * @throws JIException will <i>also</i> get thrown in case the <code>session</code> is associated with another server already.
 * @throws IllegalArgumentException raised when any of the parameters is <code>null</code>.
 * @throws UnknownHostException
 */
public JIComServer(JIProgId progId,String address, JISession session) throws JIException, UnknownHostException
{
	super();

	if (progId == null || address == null || session == null)
	{
		throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_COMSTUB_ILLEGAL_ARGUMENTS));
	}

	if (session.getStub() != null)
	{
		throw new JIException(JIErrorCodes.JI_SESSION_ALREADY_ESTABLISHED);
	}

	if (session.isSSOEnabled())
	{
		throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_COMSTUB_ILLEGAL_ARGUMENTS2));
	}
	
	address = address.trim();
	address = InetAddress.getByName(address).getHostAddress();

	progId.setSession(session);
	progId.setServer(address);
	address = "ncacn_ip_tcp:"+address+"[135]";
	JIClsid clsid = progId.getCorrespondingCLSID();
	initialise(clsid,address,session);
}
 
开发者ID:howie,项目名称:jinterop,代码行数:38,代码来源:JIComServer.java

示例12: getIDsOfNames

import org.jinterop.dcom.common.JISystem; //导入方法依赖的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.
}
 
开发者ID:howie,项目名称:jinterop,代码行数:44,代码来源:JIDispatchImpl.java

示例13: JIArray

import org.jinterop.dcom.common.JISystem; //导入方法依赖的package包/类
/**<p> Creates an array object with members of the type <code>template</code>. 
 * This constructor is used to prepare a template for decoding an array and is
 * exclusively for composites like <code>JIStruct</code>, <code>JIPointer</code>, 
 * <code>JIUnion</code>, <code>JIString</code> where more information on the 
 * structure of the composite is required before trying to deserialize it.
 * 
 *<p>
 *  
 *  Sample Usage:-
 *  <br>
 *  <code>
 *  JIStruct safeArrayBounds = new JIStruct(); <br>
 *	safeArrayBounds.addMember(Integer.class); <br>
 *	safeArrayBounds.addMember(Integer.class); <br><br>
 *	
 *	//arraydesc <br>
 *	JIStruct arrayDesc = new JIStruct(); <br>
 *	//typedesc <br>
 *	JIStruct typeDesc = new JIStruct(); <br><br>
 *	
 *	arrayDesc.addMember(typeDesc);<br>
 *	arrayDesc.addMember(Short.class);<br>
 *	arrayDesc.addMember(<b>new JIArray(safeArrayBounds,new int[]{1},1,true)</b>);<br>
 *  </code>
 *  </p>
 * @param template can be only of the type <code>JIStruct</code>, <code>JIPointer</code>, 
 * <code>JIUnion</code>, <code>JIString</code>
 * @param upperBounds highest index for each dimension.
 * @param dimension number of dimensions
 * @param isConformant declares whether the array is <i>conformant</i> or not.  
 * @throws IllegalArgumentException if <code>upperBounds</code> is supplied and its length
 * is not equal to the <code>dimension</code> parameter.
 * @throws IllegalArgumentException if <code>template</code> is null or is not of the 
 * specified types.
 */
//for structs, pointers , unions.
public JIArray(Object template, int[] upperBounds,int dimension, boolean isConformant)
{
	if (template == null)
	{
		throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_ARRAY_TEMPLATE_NULL));
	}

	if (!template.getClass().equals(JIStruct.class) && !template.getClass().equals(JIUnion.class)
		&& !template.getClass().equals(JIPointer.class) && !template.getClass().equals(JIString.class))
	{
		throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_ARRAY_INCORRECT_TEMPLATE_PARAM));
	}
	
	this.template = template;
	this.clazz = template.getClass();
	
	init2(upperBounds,dimension,isConformant,false);
}
 
开发者ID:howie,项目名称:jinterop,代码行数:55,代码来源:JIArray.java

示例14: serializeData

import org.jinterop.dcom.common.JISystem; //导入方法依赖的package包/类
public void serializeData(NetworkDataRepresentation ndr,Object value,List defferedPointers,int FLAG)
{
	throw new IllegalStateException(JISystem.getLocalizedMessage(JIErrorCodes.JI_UTIL_INCORRECT_CALL));
}
 
开发者ID:howie,项目名称:jinterop,代码行数:5,代码来源:JIMarshalUnMarshalHelper.java

示例15: deserializeData

import org.jinterop.dcom.common.JISystem; //导入方法依赖的package包/类
public Object deserializeData(NetworkDataRepresentation ndr,List defferedPointers, Map additionalData, int FLAG)
{
	throw new IllegalStateException(JISystem.getLocalizedMessage(JIErrorCodes.JI_UTIL_INCORRECT_CALL));
}
 
开发者ID:howie,项目名称:jinterop,代码行数:5,代码来源:JIMarshalUnMarshalHelper.java


注:本文中的org.jinterop.dcom.common.JISystem.getLocalizedMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。