org.jinterop.dcom.core
Class JIComServer

java.lang.Object
  extended by Stub
      extended by org.jinterop.dcom.core.JIComServer

public final class JIComServer
extends Stub

Startup class representing a COM Server.

Sample Usage :-
JISession session = JISession.createSession("DOMAIN","USERNAME","PASSWORD");
JIComServer excelServer = new JIComServer(JIProgId.valueOf("Excel.Application"),address,session);
IJIComObject comObject = excelServer.createInstance();
//Obtaining the IJIDispatch (if supported)
IJIDispatch dispatch = (IJIDispatch)JIObjectFactory.narrowObject(comObject.queryInterface(IJIDispatch.IID));

Each instance of this class is associated with a single session only.

Since:
1.0

Constructor Summary
JIComServer(JIClsid clsid, JISession session)
          JIClsid based constructor with the host machine for COM server being LOCALHOST.
JIComServer(JIClsid clsid, java.lang.String address, JISession session)
          Refer JIComServer(JIClsid, JISession) for details.
JIComServer(JIProgId progId, JISession session)
          JIProgId based constructor with the host machine for COM server being LOCALHOST.
JIComServer(JIProgId progId, java.lang.String address, JISession session)
          Refer JIComServer(JIProgId, JISession) for details.
 
Method Summary
 IJIComObject createInstance()
          Returns an IJIComObject representing the COM Server.
protected  java.lang.String getSyntax()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JIComServer

public JIComServer(JIProgId progId,
                   JISession session)
            throws JIException,
                   java.net.UnknownHostException

JIProgId based constructor with the host machine for COM server being LOCALHOST.

Parameters:
progId - user-friendly string such as "Excel.Application" , "TestCOMServer.Test123" etc.
session - session to be associated with.
Throws:
JIException - will also get thrown in case the session is associated with another server already.
java.lang.IllegalArgumentException - raised when either progId or session is null.
java.net.UnknownHostException

JIComServer

public JIComServer(JIClsid clsid,
                   JISession session)
            throws java.lang.IllegalArgumentException,
                   JIException,
                   java.net.UnknownHostException

JIClsid based constructor with the host machine for COM server being LOCALHOST.

Parameters:
clsid - 128 bit string such as "00024500-0000-0000-C000-000000000046".
session - session to be associated with.
Throws:
JIException - will also get thrown in case the session is associated with another server already.
java.lang.IllegalArgumentException - raised when either clsid or session is null.
java.net.UnknownHostException

JIComServer

public JIComServer(JIProgId progId,
                   java.lang.String address,
                   JISession session)
            throws JIException,
                   java.net.UnknownHostException

Refer JIComServer(JIProgId, JISession) for details.

Parameters:
progId - user-friendly string such as "Excel.Application" , "TestCOMServer.Test123" etc.
address - address of the host where the COM object resides.This should be in the IEEE IP format (e.g. 192.168.170.6) or a resolvable HostName.
session - session to be associated with.
Throws:
JIException - will also get thrown in case the session is associated with another server already.
java.lang.IllegalArgumentException - raised when any of the parameters is null.
java.net.UnknownHostException

JIComServer

public JIComServer(JIClsid clsid,
                   java.lang.String address,
                   JISession session)
            throws JIException,
                   java.net.UnknownHostException

Refer JIComServer(JIClsid, JISession) for details.

Parameters:
clsid - 128 bit string such as "00024500-0000-0000-C000-000000000046".
address - address of the host where the COM object resides.This should be in the IEEE IP format (e.g. 192.168.170.6) or a resolvable HostName.
session - session to be associated with.
Throws:
JIException - will also get thrown in case the session is associated with another server already.
java.lang.IllegalArgumentException - raised when any of the parameters is null.
java.net.UnknownHostException
Method Detail

createInstance

public IJIComObject createInstance()
                            throws JIException
Returns an IJIComObject representing the COM Server.

Returns:
Throws:
JIException

getSyntax

protected java.lang.String getSyntax()