Package com.sun.star.container

Examples of com.sun.star.container.XSet


      XImplementationLoader loader = (XImplementationLoader)UnoRuntime.queryInterface(XImplementationLoader.class,
                                              compContext._xMultiServiceFactory.createInstance("com.sun.star.loader.Java"));

      Object serviceManager = compContext._xMultiServiceFactory.createInstance("com.sun.star.lang.ServiceManager");
      XSet serviceManager_xSet = (XSet)UnoRuntime.queryInterface(XSet.class, serviceManager);

      XRegistryKey xRegistryKey = new RegistryKey("ROOT");

      loader.writeRegistryInfo(xRegistryKey, null, componentName);

      String keys[] = xRegistryKey.getKeyNames();
      for(int j = 0; j < keys.length; ++ j) {
        String implName = keys[j].substring(1);
        implName = implName.substring(0, implName.length() - "/UNO/SERVICES".length());

        Object factory = loader.activate(implName, null, componentName, xRegistryKey);
        XSingleServiceFactory xSingleServiceFactory = (XSingleServiceFactory)UnoRuntime.queryInterface(XSingleServiceFactory.class,
                                                         factory);
         
        if (xSingleServiceFactory == null)
          throw new com.sun.star.loader.CannotActivateFactoryException("Can not get factory for " +  implName);
         
        serviceManager_xSet.insert(xSingleServiceFactory);
      }

      return serviceManager;
    }
View Full Code Here


        idx = arg.indexOf(',');
      }
      comps.addElement(arg);

      // now use the XSet interface at the ServiceManager to add the factory of the loader
        XSet xSet = (XSet) UnoRuntime.queryInterface(XSet.class, compContext._xMultiServiceFactory);

      for(int i = 0; i < comps.size(); ++ i) {
        Object object = new CompContext((String)comps.elementAt(i)).getObject();

        XSingleServiceFactory xSingleServiceFactory = (XSingleServiceFactory)UnoRuntime.queryInterface(XSingleServiceFactory.class,
                                                         object);
        if(xSingleServiceFactory == null) {
          XMultiServiceFactory xMultiServiceFactory = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class,
                                                           object);

          if(xMultiServiceFactory != null) {
            String services[] = xMultiServiceFactory.getAvailableServiceNames();
           
            for(int j = 0; j < services.length; ++ j)
              xSet.insert(new DelegatorSingleServiceFactory(xMultiServiceFactory, services[j]));
          }
          else
            System.err.println("warning! -- " + object + " is neither XSingleServiceFactory nor XMultiServiceFactory");
        }
        else
          xSet.insert(xSingleServiceFactory);
      }
    }
View Full Code Here

        XMultiComponentFactory smgr = ctx.getServiceManager();
        XMultiServiceFactory oldsmgr = (XMultiServiceFactory)
            UnoRuntime.queryInterface( XMultiServiceFactory.class, smgr );

        // prepare servicemanager
        XSet set = (XSet) UnoRuntime.queryInterface(XSet.class, smgr);
        Object o = com.sun.star.comp.bridge.TestComponent.__getServiceFactory(
            "com.sun.star.comp.bridge.TestComponent$_TestObject", oldsmgr,null );
        set.insert(o);
       
    XAcceptor xAcceptor = Acceptor.create(ctx);

        while( true )
        {
View Full Code Here

        try
        {
            // at our service factory, insert a new factory for our CallbackComponent
            // this will allow the Basic code in our test documents to call back into this test case
            // here, by just instantiating this service
            XSet globalFactory = (XSet)UnoRuntime.queryInterface(
                XSet.class, getORB() );
            m_callbackFactory = new CallbackComponentFactory();
            globalFactory.insert( m_callbackFactory );
           
            // register ourself as listener at the global event broadcaster
            XDocumentEventBroadcaster broadcaster = (XDocumentEventBroadcaster)UnoRuntime.queryInterface(
                XDocumentEventBroadcaster.class, getORB().createInstance( "com.sun.star.frame.GlobalEventBroadcaster" ) );
            broadcaster.addDocumentEventListener( this );
View Full Code Here

   
    public static void insertIntoServiceManager(
        XMultiComponentFactory serviceManager, Object singleFactory )
        throws com.sun.star.uno.Exception
    {
        XSet set = (XSet ) UnoRuntime.queryInterface( XSet.class, serviceManager );
        set.insert( singleFactory );
    }
View Full Code Here

    public static void removeFromServiceManager(
        XMultiComponentFactory serviceManager, Object singleFactory )
        throws com.sun.star.uno.Exception
    {
        XSet set = (XSet ) UnoRuntime.queryInterface( XSet.class, serviceManager );
        set.remove( singleFactory );
       
    }
View Full Code Here

    Object[]  initargs  = { serviceMgr };  
    init.initialize(initargs);

    // Use the XSet interface at the ServiceManager to add the factory of
    // the loader
    XSet  serviceMgrXSet  = (XSet)UnoRuntime.queryInterface(
      XSet.class, serviceMgr);

    XSingleServiceFactory  singleServiceFact;
    // Add the factory of the loader
    singleServiceFact  = (XSingleServiceFactory)UnoRuntime.queryInterface(
      XSingleServiceFactory.class,
      implLoader.activate(
        "com.sun.star.comp.loader.JavaLoader", null, null, null));
    serviceMgrXSet.insert(singleServiceFact);
               
    // Add the service manager
    serviceMgrXSet.insert(managerFact);

    // Add the factory of the URLResolver       
    singleServiceFact  = (XSingleServiceFactory)UnoRuntime.queryInterface(
      XSingleServiceFactory.class,
      implLoader.activate(
        "com.sun.star.comp.urlresolver.UrlResolver", null, null, null));
    serviceMgrXSet.insert(singleServiceFact);

    // Add the bridgefactory
    singleServiceFact  = (XSingleServiceFactory)UnoRuntime.queryInterface(
      XSingleServiceFactory.class,
      implLoader.activate(
        "com.sun.star.comp.bridgefactory.BridgeFactory", null, null, null));
    serviceMgrXSet.insert(singleServiceFact);

    // Ufff ... that's all
    mLocalServiceFactory = serviceMgr;
  }
View Full Code Here

    xInit = (XInitialization)UnoRuntime.queryInterface(
            XInitialization.class, xSMgr );
    args = new Object [] { null, xContext }; // no registry, default context
    xInit.initialize( args );
       
    XSet xSet = (XSet)UnoRuntime.queryInterface( XSet.class, xSMgr );
    // insert the service manager
    xSet.insert( smgr_fac );
        // and basic jurt factories
        insertBasicFactories( xSet, xImpLoader );
       
    return xContext;
  }
View Full Code Here

          XInitialization xInit = (XInitialization) UnoRuntime.queryInterface( XInitialization.class, xImpLoader );
          Object[] iniargs = { xMultiFac };
         
          xInit.initialize( iniargs );
         
      XSet xSet = (XSet) UnoRuntime.queryInterface(XSet.class, xMultiFac);
      xSet.insert( xSingleServiceFactory );
         
            System.err.println("create ServiceManager");
            System.err.println();
           
            manager = (ServiceManager) xSet;                       
View Full Code Here

          XInitialization xInit = (XInitialization) UnoRuntime.queryInterface( XInitialization.class, xImpLoader );
          Object[] iniargs = { xMultiFac };
         
          xInit.initialize( iniargs );
         
      XSet xSet = (XSet) UnoRuntime.queryInterface(XSet.class, xMultiFac);
      xSet.insert( xSingleServiceFactory );
         
            System.err.println("create ServiceManager");
            System.err.println();
           
            manager = (ServiceManager) xSet;                       
View Full Code Here

TOP

Related Classes of com.sun.star.container.XSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.