|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IJIComObject
Represents a COM
Object. All interfaces (representing COM
objects)
for e.g. IJIDispatch, IJITypeInfo must extend from this interface.
Sample usage:-
JISession session = JISession.createSession("DOMAIN","USERNAME","PASSWORD");
JIComServer comserver = new JIComServer(JIProgId.valueOf(session,"Word.Application"),address,session);
IJIComObject comObject = comserver.createInstance();
Also ,
IJIComObject handle = (IJIComObject)comObject.queryInterface("620012E2-69E3-4DC0-B553-AE252524D2F6");
Field Summary |
---|
Fields inherited from interface org.jinterop.dcom.core.IJIUnknown |
---|
IID |
Method Summary | |
---|---|
java.lang.Object[] |
call(JICallObject obj)
Executes a method call on the actual COM object represented by this interface. |
java.lang.Object[] |
call(JICallObject obj,
int timeout)
Executes a method call on the actual COM object represented by this interface. |
JISession |
getAssociatedSession()
Session associated with this object. |
int |
getInstanceLevelSocketTimeout()
Returns the timeout set at the instance level. |
java.lang.String |
getInterfaceIdentifier()
Returns the IID of this object |
JIInterfacePointer |
getInterfacePointer()
Returns self Interface pointer |
java.lang.String |
getIpid()
Unique 128 bit uuid representing the interface on the COM server. |
IJIUnreferenced |
getUnreferencedHandler(JISession session)
Returns the IJIUnreferenced handler associated with this comObject, null if none is. |
boolean |
isDispatchSupported()
Returns true if IJIDispatch is supported by this interface. |
void |
registerUnreferencedHandler(JISession session,
IJIUnreferenced unreferenced)
Adds a IJIUnreferenced handler , the handler will be invoked when this comObject goes out of reference and is removed from the session by the library. |
java.lang.Object[] |
removeConnectionInfo(java.lang.String identifier)
Returns and Removes the connection info from the internal map. |
void |
setInstanceLevelSocketTimeout(int timeout)
Sets a timeout for all socket level operations , overrides the global socket timeout at the JISession level. |
void |
unregisterUnreferencedHandler(JISession session)
Removes the IJIUnreferenced handler associated with this comObject. |
Methods inherited from interface org.jinterop.dcom.core.IJIUnknown |
---|
addRef, queryInterface, release |
Method Detail |
---|
java.lang.String getIpid()
COM
server.
java.lang.Object[] call(JICallObject obj) throws JIException
Executes a method call on the actual COM
object represented by this interface. All the data like parameter information, operation number etc. are
prepared and sent via the JICallObject.
JICallObject obj = new JICallObject(handle.getIpid());
obj.reInit();
obj.setOpnum(94); //This needs to be obtained via IDL, Other wise use IJIDispatch if COM IDispatch
//interface is supported by the underlying COM Object.
obj.addInParamAsPointer(new JIPointer(new JIString("j-Interop Rocks",JIFlags.FLAG_REPRESENTATION_STRING_LPCTSTR)), JIFlags.FLAG_NULL);
obj.addInParamAsPointer(new JIPointer(new JIString("Pretty simple ;)",JIFlags.FLAG_REPRESENTATION_STRING_LPCTSTR)), JIFlags.FLAG_NULL);
Object[] result = handle.call(obj);
The above example demonstrates a call where no results are expected. When you expect something to be returned back
, set up the Out Params also in the JICallObject (see corresponding JICallObject javadoc for more details).
The timeout used here , by default is the instance level timeout. If not instance level timeout has been specified(or is 0) then the global timeout in JISession
will be used.
obj
- Data Object carrying all information neccessary to make the call.
JIException
java.lang.Object[] call(JICallObject obj, int timeout) throws JIException
Executes a method call on the actual COM
object represented by this interface. All the data like parameter information, operation number etc. are
prepared and sent via the JICallObject.
JICallObject obj = new JICallObject(handle.getIpid());
obj.reInit();
obj.setOpnum(94); //This needs to be obtained via IDL, Other wise use IJIDispatch if COM IDispatch
//interface is supported by the underlying COM Object.
obj.addInParamAsPointer(new JIPointer(new JIString("j-Interop Rocks",JIFlags.FLAG_REPRESENTATION_STRING_LPCTSTR)), JIFlags.FLAG_NULL);
obj.addInParamAsPointer(new JIPointer(new JIString("Pretty simple ;)",JIFlags.FLAG_REPRESENTATION_STRING_LPCTSTR)), JIFlags.FLAG_NULL);
Object[] result = handle.call(obj);
The above example demonstrates a call where no results are expected. When you expect something to be returned back
, set up the Out Params also in the JICallObject (see corresponding JICallObject javadoc for more details).
obj
- Data Object carrying all information necessary to make the call.timeout
- timeout for this call in millisecs, overrides the instance level timeout. Passing 0 here will use the global socket timeout (not the class level timeout) .
JIException
void setInstanceLevelSocketTimeout(int timeout)
timeout
- int getInstanceLevelSocketTimeout()
JIInterfacePointer getInterfacePointer()
JISession getAssociatedSession()
java.lang.String getInterfaceIdentifier()
boolean isDispatchSupported()
IJIDispatch
is supported by this interface.
java.lang.Object[] removeConnectionInfo(java.lang.String identifier)
identifier
-
void registerUnreferencedHandler(JISession session, IJIUnreferenced unreferenced)
session
- unreferenced
- IJIUnreferenced getUnreferencedHandler(JISession session)
session
-
void unregisterUnreferencedHandler(JISession session)
session
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |