Package com.sun.star.container

Examples of com.sun.star.container.XSet


        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);

    System.err.println("waiting for connect...");
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

    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

    Object[] iniargs = { xMultiFac };  
    xInit.initialize( iniargs );
   

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

    // Get the factory of the loader       
    XSingleServiceFactory xSingleServiceFactory = (XSingleServiceFactory) UnoRuntime.queryInterface(XSingleServiceFactory.class,
                                                    xImpLoader.activate("com.sun.star.comp.loader.JavaLoader", null, null, null));

    // add the javaloader
    xSet.insert(xSingleServiceFactory);
   
    // add the service manager
    xSet.insert(xManagerFac);

    // Get the factory of the URLResolver       
    xSingleServiceFactory = (XSingleServiceFactory)UnoRuntime.queryInterface(XSingleServiceFactory.class,
                                         xImpLoader.activate("com.sun.star.comp.urlresolver.UrlResolver", null, null, null));
    xSet.insert(xSingleServiceFactory);

    // add the bridgefactory
    xSingleServiceFactory = (XSingleServiceFactory)UnoRuntime.queryInterface(XSingleServiceFactory.class,
                                         xImpLoader.activate("com.sun.star.comp.bridgefactory.BridgeFactory", null, null, null));
    xSet.insert(xSingleServiceFactory);

    // add the connector
    xSingleServiceFactory = (XSingleServiceFactory)UnoRuntime.queryInterface(XSingleServiceFactory.class,
                                         xImpLoader.activate("com.sun.star.comp.connections.Connector", null, null, null));
    xSet.insert(xSingleServiceFactory);
   
    // add the acceptor
    xSingleServiceFactory = (XSingleServiceFactory)UnoRuntime.queryInterface(XSingleServiceFactory.class,
                                         xImpLoader.activate("com.sun.star.comp.connections.Acceptor", null, null, null));
    xSet.insert(xSingleServiceFactory);

    return xMultiFac;
  }
View Full Code Here

      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

            XPropertySet xProps = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, xMgr );
            XComponentContext xContext = (XComponentContext)AnyConverter.toObject(
                new Type( XComponentContext.class ), xProps.getPropertyValue( "DefaultContext" ) );
            // insert java loader
            XSet xSet = (XSet)AnyConverter.toObject(
                new Type( XSet.class ), xContext.getServiceManager() );
            xSet.insert( new com.sun.star.comp.loader.JavaLoaderFactory( xMgr ) );
            // get rdb of smgr
            XSimpleRegistry xRDB = (XSimpleRegistry)AnyConverter.toObject(
                new Type( XSimpleRegistry.class ), xProps.getPropertyValue( "Registry" ) );
            // register impl
            XImplementationRegistration xImpReg =
View Full Code Here

            oFilter = new Filter();
            oDocumentHandler = new DocumentHandler();
      oThreadRunner = new ThreadRunner(xMSF);
            oCeptor = new DispatchProviderInterceptor() ;
            oAttributeList = new AttributeList();
            XSet xMSFSet = (XSet)UnoRuntime.queryInterface(XSet.class, xMSF);

            try {
                xMSFSet.insert(oHandler);
                xMSFSet.insert(oConnector);
                xMSFSet.insert(oFilter);
                xMSFSet.insert(oDocumentHandler);
    xMSFSet.insert(oThreadRunner);
                xMSFSet.insert(oCeptor);
                xMSFSet.insert(oAttributeList);
            } catch (ElementExistException e) {
                System.out.println(e.toString());
            } catch (IllegalArgumentException e) {
                System.out.println(e.toString());
            }
View Full Code Here

        try {
            if (oHandler != null) {
                oHandler.dispose();
            }
            if (MSF != null) {
                XSet xMSFSet = (XSet)UnoRuntime.queryInterface(XSet.class, MSF);
                xMSFSet.remove(oHandler);
                xMSFSet.remove(oFilter);
                xMSFSet.remove(oConnector);
                xMSFSet.remove(oDocumentHandler);
    xMSFSet.remove(oThreadRunner);
                xMSFSet.remove(oAttributeList);
            }
        } catch (Exception e){
            System.out.println(e.toString());
        }
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.