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


Java JIComServer.createInstance方法代码示例

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


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

示例1: main

import org.jinterop.dcom.core.JIComServer; //导入方法依赖的package包/类
public static void main(String[] args) {
	
		try {
				
			JISession session = JISession.createSession();
			JIComServer comServer = new JIComServer(JIClsid.valueOf("00024500-0000-0000-C000-000000000046"), session);
			IJIComObject comObject = comServer.createInstance();
			int h = 0;
			
//			SSPIJNIClient jniClient = SSPIJNIClient.getInstance();
//			byte[] type1Message = jniClient.invokePrepareSSORequest();
//			jcifs.util.Hexdump.hexdump(System.out, type1Message, 0, type1Message.length);
//			int h = 0;
//			
//			jniClient.invokeUnInitialize();
//			
//			type1Message = new Type1Message().toByteArray();
//			jcifs.util.Hexdump.hexdump(System.out, type1Message, 0, type1Message.length);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 
		
	}
 
开发者ID:howie,项目名称:jinterop,代码行数:25,代码来源:TestWinNativeSSO.java

示例2: main

import org.jinterop.dcom.core.JIComServer; //导入方法依赖的package包/类
public static void main ( final String[] args ) throws IllegalArgumentException, UnknownHostException, JIException
{
    final TestConfiguration configuration = new MatrikonSimulationServerConfiguration ();

    OPCServer server = null;
    try
    {
        JISystem.setAutoRegisteration ( true );

        _session = JISession.createSession ( args[1], args[2], args[3] );

        //JIComServer comServer = new JIComServer ( JIClsid.valueOf ( configuration.getCLSID () ), args[0], _session );
        final JIComServer comServer = new JIComServer ( JIProgId.valueOf ( configuration.getProgId () ), args[0], _session );

        final IJIComObject serverObject = comServer.createInstance ();
        server = new OPCServer ( serverObject );

        final OPCGroupStateMgt group = server.addGroup ( "test", true, 100, 1234, 60, 0.0f, 1033 );

        testItems ( server, group, configuration.getReadItems () );
        server.removeGroup ( group, true );
    }
    catch ( final JIException e )
    {
        e.printStackTrace ();
        showError ( server, e.getErrorCode () );
    }
    finally
    {
        if ( _session != null )
        {
            JISession.destroySession ( _session );
        }
        _session = null;
    }
}
 
开发者ID:luoyan35714,项目名称:OPC_Client,代码行数:37,代码来源:Test2.java

示例3: main

import org.jinterop.dcom.core.JIComServer; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
	JISystem.setAutoRegisteration(true);

	/**
	 * Session获取
	 */
	JISession _session = JISession.createSession(
			getEntryValue(CONFIG_DOMAIN), getEntryValue(CONFIG_USERNAME),
			getEntryValue(CONFIG_PASSWORD));

	final JIComServer comServer = new JIComServer(
			JIClsid.valueOf(getEntryValue(CONFIG_CLSID)),
			getEntryValue(CONFIG_HOST), _session);

	final IJIComObject serverObject = comServer.createInstance();

	OPCServer server = new OPCServer(serverObject);

	/**
	 * 添加一个Group的信息
	 */
	OPCGroupStateMgt group = server.addGroup("test", true, 100, 1234, 60,
			0.0f, 1033);

	testItems(server, group, new String[] { "Saw-toothed Waves.Int2",
			"Saw-toothed Waves.test2" });

	// clean up
	server.removeGroup(group, true);
}
 
开发者ID:luoyan35714,项目名称:OPC_Client,代码行数:31,代码来源:DCOMTest4.java

示例4: main

import org.jinterop.dcom.core.JIComServer; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
	JISystem.setAutoRegisteration(true);

	/**
	 * Session获取
	 */
	JISession _session = JISession.createSession(
			getEntryValue(CONFIG_DOMAIN), getEntryValue(CONFIG_USERNAME),
			getEntryValue(CONFIG_PASSWORD));

	final JIComServer comServer = new JIComServer(
			JIClsid.valueOf(getEntryValue(CONFIG_CLSID)),
			getEntryValue(CONFIG_HOST), _session);

	final IJIComObject serverObject = comServer.createInstance();

	OPCServer server = new OPCServer(serverObject);
	final OPCBrowseServerAddressSpace serverBrowser = server.getBrowser();

	/**
	 * Flat形式获取所有Item信息
	 */
	browseFlat(serverBrowser);

	/**
	 * 获取所有的Group和Item信息
	 */
	browseTree(serverBrowser);

}
 
开发者ID:luoyan35714,项目名称:OPC_Client,代码行数:31,代码来源:DCOMTest2.java

示例5: main

import org.jinterop.dcom.core.JIComServer; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
	JISystem.setAutoRegisteration(true);

	/**
	 * Session获取
	 */
	JISession _session = JISession.createSession(
			getEntryValue(CONFIG_DOMAIN), getEntryValue(CONFIG_USERNAME),
			getEntryValue(CONFIG_PASSWORD));

	final JIComServer comServer = new JIComServer(
			JIClsid.valueOf(getEntryValue(CONFIG_CLSID)),
			getEntryValue(CONFIG_HOST), _session);

	final IJIComObject serverObject = comServer.createInstance();

	OPCServer server = new OPCServer(serverObject);

	/**
	 * 添加一个Group的信息
	 */
	OPCGroupStateMgt group = server.addGroup("test", true, 100, 1234, 60,
			0.0f, 1033);

	final OPCItemIO itemIO = server.getItemIOService();
	queryItems(itemIO, "Saw-toothed Waves.Int1");

	// clean up
	server.removeGroup(group, true);
}
 
开发者ID:luoyan35714,项目名称:OPC_Client,代码行数:31,代码来源:DCOMTest6.java

示例6: main

import org.jinterop.dcom.core.JIComServer; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
	JISystem.setAutoRegisteration(true);

	/**
	 * Session获取
	 */
	JISession _session = JISession.createSession(
			getEntryValue(CONFIG_DOMAIN), getEntryValue(CONFIG_USERNAME),
			getEntryValue(CONFIG_PASSWORD));

	final JIComServer comServer = new JIComServer(
			JIClsid.valueOf(getEntryValue(CONFIG_CLSID)),
			getEntryValue(CONFIG_HOST), _session);

	final IJIComObject serverObject = comServer.createInstance();

	OPCServer server = new OPCServer(serverObject);

	/**
	 * 添加一个Group的信息
	 */
	OPCGroupStateMgt group = server.addGroup("test", true, 100, 1234, 60,
			0.0f, 1033);

	final OPCItemProperties itemProperties = server
			.getItemPropertiesService();
	dumpItemProperties(itemProperties, "Saw-toothed Waves.Int");

	// clean up
	server.removeGroup(group, true);
	LOGGER.info("test");
}
 
开发者ID:luoyan35714,项目名称:OPC_Client,代码行数:33,代码来源:DCOMTest5.java

示例7: main

import org.jinterop.dcom.core.JIComServer; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
	JISystem.setAutoRegisteration(true);

	/**
	 * Session获取
	 */
	JISession _session = JISession.createSession(
			getEntryValue(CONFIG_DOMAIN), getEntryValue(CONFIG_USERNAME),
			getEntryValue(CONFIG_PASSWORD));

	final JIComServer comServer = new JIComServer(
			JIClsid.valueOf(getEntryValue(CONFIG_CLSID)),
			getEntryValue(CONFIG_HOST), _session);

	final IJIComObject serverObject = comServer.createInstance();

	OPCServer server = new OPCServer(serverObject);

	/**
	 * 添加一个Group的信息
	 */
	OPCGroupStateMgt group = server.addGroup("test", true, 100, 1234, 60,
			0.0f, 1033);

	enumerateGroups(server, OPCENUMSCOPE.OPC_ENUM_PUBLIC);
	enumerateGroups(server, OPCENUMSCOPE.OPC_ENUM_PRIVATE);
	enumerateGroups(server, OPCENUMSCOPE.OPC_ENUM_ALL);

	// clean up
	server.removeGroup(group, true);
}
 
开发者ID:luoyan35714,项目名称:OPC_Client,代码行数:32,代码来源:DCOMTest3.java

示例8: main

import org.jinterop.dcom.core.JIComServer; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {

		JISystem.setAutoRegisteration(true);

		/**
		 * Session获取
		 */
		JISession _session = JISession.createSession(
				getEntryValue(CONFIG_DOMAIN), getEntryValue(CONFIG_USERNAME),
				getEntryValue(CONFIG_PASSWORD));

		final JIComServer comServer = new JIComServer(
				JIClsid.valueOf(getEntryValue(CONFIG_CLSID)),
				getEntryValue(CONFIG_HOST), _session);

		final IJIComObject serverObject = comServer.createInstance();

		OPCServer server = new OPCServer(serverObject);

		/**
		 * 添加一个Group的信息
		 */
		OPCGroupStateMgt group = server.addGroup("test", true, 100, 1234, 60,
				0.0f, 1033);

		testItems(group, new String[] { "Saw-toothed Waves.Int2" });

		// clean up
		server.removeGroup(group, true);

	}
 
开发者ID:luoyan35714,项目名称:OPC_Client,代码行数:32,代码来源:DCOMTest7.java

示例9: MSWMI2

import org.jinterop.dcom.core.JIComServer; //导入方法依赖的package包/类
public MSWMI2(String address, String[] args) throws JIException, UnknownHostException
	{
		this.address = address;
		session = JISession.createSession(args[1],args[2],args[3]);
//		session.useSessionSecurity(true);
//		session.setGlobalSocketTimeout(5000);
		comStub = new JIComServer(JIClsid.valueOf("76a64158-cb41-11d1-8b02-00600806d9b6"),address,session);
		IJIComObject unknown = comStub.createInstance();
		comObject = (IJIComObject)unknown.queryInterface("76A6415B-CB41-11d1-8B02-00600806D9B6");//ISWbemLocator
		//This will obtain the dispatch interface
		dispatch = (IJIDispatch)JIObjectFactory.narrowObject(comObject.queryInterface(IJIDispatch.IID));
	}
 
开发者ID:howie,项目名称:jinterop,代码行数:13,代码来源:MSWMI2.java

示例10: MSSysInfo

import org.jinterop.dcom.core.JIComServer; //导入方法依赖的package包/类
MSSysInfo(String[] args) throws JIException, UnknownHostException
{
	session = JISession.createSession(args[1],args[2],args[3]);
	session.useSessionSecurity(true);
	JIComServer comServer = new JIComServer(JIProgId.valueOf("SYSINFO.SysInfo"),args[0],session);
	sysInfoServer = comServer.createInstance();
	sysInfoObject = (IJIComObject)sysInfoServer.queryInterface("6FBA474C-43AC-11CE-9A0E-00AA0062BB4C");
	dispatch = (IJIDispatch)JIObjectFactory.narrowObject(sysInfoObject.queryInterface(IJIDispatch.IID));

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

示例11: main

import org.jinterop.dcom.core.JIComServer; //导入方法依赖的package包/类
public static void main(String[] args) {

		try {

				if (args.length < 4)
			    {
			    	System.out.println("Please provide address domain username password");
			    	return;
			    }
				JISystem.setInBuiltLogHandler(false);
				JISystem.setAutoRegisteration(true);
				for (int i=0;i<10000;++i)
				{

					JISession session = JISession.createSession(args[1],args[2],args[3]);
					JIComServer comServer = new JIComServer(JIProgId.valueOf("MSMQ.MSMQQueueInfo"),args[0],session);
					IJIComObject unknown = comServer.createInstance();
					IJIDispatch dispatch = (IJIDispatch)JIObjectFactory.narrowObject(unknown.queryInterface(IJIDispatch.IID));
					//JISession.destroySession(session);
					Thread.sleep(150);
					if(i%100 == 0)
					{
						System.out.println(new String().valueOf(i));
					}
					System.gc();
				}

		} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
	}
 
开发者ID:howie,项目名称:jinterop,代码行数:33,代码来源:Test10KServer.java

示例12: MSEnumVariant

import org.jinterop.dcom.core.JIComServer; //导入方法依赖的package包/类
public MSEnumVariant(String address,String[] args) throws JIException, UnknownHostException
{
	session = JISession.createSession(args[1],args[2],args[3]);
	comServer = new JIComServer(JIProgId.valueOf("StdCollection.VBCollection"),address,session);
	IJIComObject object = comServer.createInstance();
	dispatch = (IJIDispatch)JIObjectFactory.narrowObject(object.queryInterface(IJIDispatch.IID));

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

示例13: MSWMI

import org.jinterop.dcom.core.JIComServer; //导入方法依赖的package包/类
public MSWMI(String address, String[] args) throws JIException, UnknownHostException
{
	this.address = address;
	session = JISession.createSession(args[1],args[2],args[3]);
	session.useSessionSecurity(true);
	session.setGlobalSocketTimeout(5000);
	comStub = new JIComServer(JIProgId.valueOf("WbemScripting.SWbemLocator"),address,session);
	IJIComObject unknown = comStub.createInstance();
	comObject = (IJIComObject)unknown.queryInterface("76A6415B-CB41-11d1-8B02-00600806D9B6");//ISWbemLocator
	//This will obtain the dispatch interface
	dispatch = (IJIDispatch)JIObjectFactory.narrowObject(comObject.queryInterface(IJIDispatch.IID));
}
 
开发者ID:howie,项目名称:jinterop,代码行数:13,代码来源:MSWMI.java

示例14: SampleTestServer

import org.jinterop.dcom.core.JIComServer; //导入方法依赖的package包/类
public SampleTestServer(String address, String[] args) throws JIException, UnknownHostException {
  this.address = address;
  session = JISession.createSession(args[1], args[2], args[3]);
  comStub = new JIComServer(JIProgId.valueOf("SampleTestServer.TestServer"), address, session);
  IJIComObject unknown = comStub.createInstance();
  comObject = (IJIComObject) unknown.queryInterface("1F438B1C-02BA-462E-A971-8E0640C141E5"); //ITestServer
}
 
开发者ID:howie,项目名称:jinterop,代码行数:8,代码来源:SampleTestServer.java

示例15: MSInternetExplorer

import org.jinterop.dcom.core.JIComServer; //导入方法依赖的package包/类
public MSInternetExplorer(String address, String[] args) throws JIException, UnknownHostException
{
	JISystem.mapHostNametoIP("locutus", "192.168.0.130");
	session = JISession.createSession(args[1],args[2],args[3]);
	session.useNTLMv2(true);
	session.useSessionSecurity(true);
	comServer = new JIComServer(JIProgId.valueOf("InternetExplorer.Application"),address,session);
	ieObject = comServer.createInstance();
	IJIComObject ieObjectWebBrowser2 = (IJIComObject)ieObject.queryInterface("D30C1661-CDAF-11D0-8A3E-00C04FC9E26E");
	ieObjectDispatch = (IJIDispatch)JIObjectFactory.narrowObject((IJIComObject)ieObject.queryInterface(IJIDispatch.IID));

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


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