Tabnine Logo
IJIComObject
Code IndexAdd Tabnine to your IDE (free)

How to use
IJIComObject
in
org.jinterop.dcom.core

Best Java code snippets using org.jinterop.dcom.core.IJIComObject (Showing top 20 results out of 315)

origin: org.openscada.jinterop/org.openscada.jinterop.core

@Override
public JISession getAssociatedSession ()
{
  return this.comObject.getAssociatedSession ();
}
origin: org.openscada.jinterop/org.openscada.jinterop.core

@Override
public void addRef () throws JIException
{
  this.comObject.addRef ();
}
origin: org.openscada.jinterop/org.openscada.jinterop.core

@Override
public int getInstanceLevelSocketTimeout ()
{
  return this.comObject.getInstanceLevelSocketTimeout ();
}
origin: org.jinterop/j-interop

void replaceMembers(IJIComObject comObject)
{
  this.session = comObject.getAssociatedSession();
  this.ptr = comObject.internal_getInterfacePointer();
}
 
origin: org.openscada.jinterop/org.openscada.jinterop.core

  logger.info ( "Attaching event handler for  comObject: " + comObject.getInterfaceIdentifier () + " , sourceUUID: " + sourceUUID + " , eventListener: " + eventListener.getInterfaceIdentifier () + " and eventListner IPID: " + eventListener.getIpid () );
final IJIComObject connectionPointContainer = comObject.queryInterface ( "B196B284-BAB4-101A-B69C-00AA00341D07" );
final JICallBuilder object = new JICallBuilder ( true );
object.setOpnum ( 1 );
object.addInParamAsUUID ( sourceUUID, JIFlags.FLAG_NULL );
object.addOutParamAsObject ( IJIComObject.class, JIFlags.FLAG_NULL );
final Object[] objects = connectionPointContainer.call ( object ); //find connection point
final IJIComObject connectionPointer = (IJIComObject)objects[0];
object.addInParamAsComObject ( eventListener, JIFlags.FLAG_NULL );
object.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL );
final Object[] obj = connectionPointer.call ( object );
connectionPointContainer.release ();
return comObject.internal_setConnectionInfo ( connectionPointer, dwcookie );
origin: org.kohsuke.jinterop/j-interop

public void startWord() throws JIException
{
  unknown = comServer.createInstance();
  IJIDispatch dispatch = (IJIDispatch)JIObjectFactory.narrowObject(unknown.queryInterface(IJIDispatch.IID));
}
origin: org.openscada.jinterop/org.openscada.jinterop.core

/**
 * @exclude
 * @param comObject
 * @param identifier
 * @throws JIException
 */
public static void detachEventHandler ( final IJIComObject comObject, final String identifier ) throws JIException
{
  final Object[] connectionInfo = comObject.internal_getConnectionInfo ( identifier );
  if ( connectionInfo == null )
  {
    throw new JIException ( JIErrorCodes.JI_CALLBACK_INVALID_ID );
  }
  logger.info ( "Detaching event handler for  comObject: {} , identifier: {}", comObject.getInterfaceIdentifier (), identifier );
  final IJIComObject connectionPointer = (IJIComObject)connectionInfo[0];
  //first use the cookie to detach.
  final JICallBuilder object = new JICallBuilder ( true );
  object.setOpnum ( 3 );
  object.addInParamAsInt ( ( (Integer)connectionInfo[1] ).intValue (), JIFlags.FLAG_NULL );
  connectionPointer.call ( object );
  //now release the connectionPointer.
  connectionPointer.release ();
}
origin: org.jinterop/j-interop

public int getTypeInfoCount() throws JIException
{
  JICallBuilder callObject = new JICallBuilder(true);
  callObject.setOpnum(0);
  callObject.addOutParamAsType(Integer.class,JIFlags.FLAG_NULL);
  Object[] result = comObject.call(callObject);
  return ((Integer)result[0]).intValue();
}
 
origin: org.openscada.jinterop/org.openscada.jinterop.core

/**
 * @exclude
 * @param IPID
 */
void addToSession ( final IJIComObject comObject, final byte[] oid )
{
  //nothing will be done if the session is being destroyed.
  if ( this.sessionInDestroy )
  {
    return;
  }
  final IPID_SessionID_Holder holder = new IPID_SessionID_Holder ( comObject.getIpid (), getSessionIdentifier (), false, oid );
  //mapOfObjects.put(new WeakReference(comObject,referenceQueueOfCOMObjects),holder);
  synchronized ( mapOfObjects )
  {
    mapOfObjects.put ( new WeakReference ( comObject, referenceQueueOfCOMObjects ), holder );
  }
  //setting if NO PING flag has been set to true.
  addToSession ( comObject.getIpid (), oid, ( (JIStdObjRef)comObject.internal_getInterfacePointer ().getObjectReference ( JIInterfacePointer.OBJREF_STANDARD ) ).getFlags () == 0x00001000 );
  logger.info ( "for IID: {}", comObject.getInterfaceIdentifier () );
  //		Integer value = (Integer)mapOfIPIDSvsCount.get(comObject.getIpid());
  //		if (value == null)
  //		{
  //			mapOfIPIDSvsCount.put(comObject.getIpid(), new Integer(0));
  //		}
  //		debug_addIpids(comObject.getIpid(),((JIStdObjRef)comObject.internal_getInterfacePointer().getObjectReference(JIInterfacePointer.OBJREF_STANDARD)).getPublicRefs());
}
origin: org.jinterop/j-interop

/** Returns the <i>IID</i> of this object
 * 
 * @return String representation of 128 bit uuid.
 */
public String getInterfaceIdentifier()
{
  return comObject.getInterfaceIdentifier();
}
 
origin: org.openscada.jinterop/org.openscada.jinterop.core

@Override
public JIInterfacePointer internal_getInterfacePointer ()
{
  return this.comObject.internal_getInterfacePointer ();
}
origin: org.jinterop/j-interop

IPID_SessionID_Holder holder = new IPID_SessionID_Holder(comObject.getIpid(),getSessionIdentifier(),false,oid);
addToSession(comObject.getIpid(),oid);
if (JISystem.getLogger().isLoggable(Level.INFO))
  JISystem.getLogger().info(" for IID: " + comObject.getInterfaceIdentifier());
origin: org.openscada.jinterop/org.openscada.jinterop.core

@Override
public String getIpid ()
{
  return this.comObject.getIpid ();
}
origin: org.jinterop/j-interop

retval.addRef();
  JIRemUnknown dispatch = new JIRemUnknown(retval.getIpid(),"00020400-0000-0000-c000-000000000046");
  try {
    call(Endpoint.IDEMPOTENT,dispatch);
origin: org.openscada.jinterop/org.openscada.jinterop.core

@Override
public IJIUnreferenced getUnreferencedHandler ()
{
  return this.comObject.getUnreferencedHandler ();
}
origin: org.openscada.jinterop/org.openscada.jinterop.core

@Override
public Object[] internal_getConnectionInfo ( final String identifier )
{
  return this.comObject.internal_getConnectionInfo ( identifier );
}
origin: org.jinterop/j-interop

  JISystem.getLogger().info("Attaching event handler for  comObject: " + comObject.getInterfaceIdentifier() + " , sourceUUID: " + sourceUUID + " , eventListener: " + eventListener.getInterfaceIdentifier() + " and eventListner IPID: " + eventListener.getIpid());
IJIComObject connectionPointContainer = (IJIComObject)comObject.queryInterface("B196B284-BAB4-101A-B69C-00AA00341D07");
JICallBuilder object = new JICallBuilder(true);
object.setOpnum(1);
object.addInParamAsUUID(sourceUUID,JIFlags.FLAG_NULL);
object.addOutParamAsObject(IJIComObject.class,JIFlags.FLAG_NULL);
Object[] objects = (Object[])connectionPointContainer.call(object); //find connection point
IJIComObject connectionPointer  = (IJIComObject)objects[0];
object.addInParamAsComObject(eventListener, JIFlags.FLAG_NULL);
object.addOutParamAsType(Integer.class,JIFlags.FLAG_NULL);
Object[] obj = connectionPointer.call(object);
connectionPointContainer.release();
return comObject.internal_setConnectionInfo(connectionPointer,dwcookie);
origin: org.openscada.jinterop/org.openscada.jinterop.core

public void startWord () throws JIException
{
  this.unknown = this.comStub.createInstance ();
  this.dispatch = (IJIDispatch)JIObjectFactory.narrowObject ( this.unknown.queryInterface ( IJIDispatch.IID ) );
}
origin: org.kohsuke.jinterop/j-interop

/**
 * @exclude
 * @param comObject
 * @param identifier
 * @throws JIException
 */
public static void detachEventHandler(IJIComObject comObject, String identifier) throws JIException
{
  Object[] connectionInfo = comObject.internal_getConnectionInfo(identifier);
  if (connectionInfo == null)
  {
    throw new JIException(JIErrorCodes.JI_CALLBACK_INVALID_ID);
  }
  if (JISystem.getLogger().isLoggable(Level.INFO))
  {
    JISystem.getLogger().info("Detaching event handler for  comObject: " + comObject.getInterfaceIdentifier() + " , identifier: " + identifier);
  }
  IJIComObject connectionPointer = (IJIComObject)connectionInfo[0];
  //first use the cookie to detach.
  JICallBuilder object = new JICallBuilder(true);
  object.setOpnum(3);
  object.addInParamAsInt(((Integer)connectionInfo[1]).intValue(),JIFlags.FLAG_NULL);
  connectionPointer.call(object);
  //now release the connectionPointer.
  connectionPointer.release();
}
origin: org.kohsuke.jinterop/j-interop

public void setTCharArray()
  throws JIException, InterruptedException, UnknownHostException {
  System.gc();
  JICallBuilder callObject = new JICallBuilder( true);
  callObject.setOpnum(7);
  Object results[];
  callObject.addInParamAsString("AHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
  results = comObject.call(callObject);
}
org.jinterop.dcom.coreIJIComObject

Javadoc

Represents a Windows COM Object. Instances of this interface can be retrieved by the following ways only :-

  • During initial handshake as expressed in the sample below.
  • As references passed from Windows COM runtime such as when using #queryInterface(String) or returned as [out] parameters to calls (directly as IJIComObject(s) or part of JIVariant (s)).
  • From raw bytes using org.jinterop.dcom.impls.JIObjectFactory#buildObject(JISession,byte[])
  • As references to local Java-COM interfaces (which are then used for event handling). See org.jinterop.dcom.impls.JIObjectFactory#buildObject(JISession,JILocalCoClass)for more details.

All references obtained by any mechanism stated above must be narrowed using org.jinterop.dcom.impls.JIObjectFactory#narrowObject(IJIComObject)before being casted to the expected type.

Sample usage :-
JISession session = JISession.createSession("DOMAIN","USERNAME","PASSWORD");
JIComServer comserver = new JIComServer(JIProgId.valueOf("Word.Application"),address,session);
IJIComObject comObject = comserver.createInstance();

Also ,
IJIComObject handle = comObject.queryInterface("620012E2-69E3-4DC0-B553-AE252524D2F6");

Note: Methods starting with internal_ keyword are internal to the framework and must not be called by the developer.

Most used methods

  • queryInterface
    Retrieve interface references based on iid. Make sure to narrow before casting to the expected type
  • call
    Refer #call(JICallBuilder) for details on this method.
  • getAssociatedSession
    Returns session associated with this object.
  • addRef
    Increases the reference count on the COM server by 5 (currently hard coded). The developer should r
  • getInstanceLevelSocketTimeout
    Returns the socket timeout set at the instance level. This timeout value is used during all socket l
  • getInterfaceIdentifier
    Returns the COM IID of this object
  • getIpid
    Unique 128 bit uuid representing the interface on the COM server. This value can and should be used
  • getUnreferencedHandler
    Returns the IJIUnreferenced handler associated with this object.
  • internal_getConnectionInfo
    Framework Internal Returns the ConnectionPoint (IJIComObject) and it's Cookie.
  • internal_getInterfacePointer
    Framework Internal Returns self Interface pointer.
  • internal_removeConnectionInfo
    Framework Internal Returns and Removes the connection info from the internal map.
  • internal_setConnectionInfo
    Adds a connection point information and it's cookie to the connectionPointMap internally. To be call
  • internal_removeConnectionInfo,
  • internal_setConnectionInfo,
  • internal_setDeffered,
  • isDispatchSupported,
  • isLocalReference,
  • registerUnreferencedHandler,
  • release,
  • setInstanceLevelSocketTimeout,
  • unregisterUnreferencedHandler

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • compareTo (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now