Examples of XNamingService


Examples of com.sun.star.uno.XNamingService

public class TestPGP {
 

  static void doSomething(Object r) throws com.sun.star.uno.Exception, IOException, Exception {
    XNamingService rName = (XNamingService)UnoRuntime.queryInterface(XNamingService.class, r);

    if(rName != null) {
      System.err.println("got the remote naming service !");
      Object rXsmgr = rName.getRegisteredObject("StarOffice.ServiceManager");
     
      XMultiServiceFactory rSmgr = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, rXsmgr);
      if(rSmgr != null) {
        System.err.println("got the remote service manager !");
      }
View Full Code Here

Examples of com.sun.star.uno.XNamingService

                dataSourceName, bibliography.getName() );

            // 2. register a newly created data source, and verify it has the proper name
            dataSourceName = "someDataSource";

            XNamingService dataSourceRegistrations = (XNamingService)UnoRuntime.queryInterface(
                XNamingService.class, getFactory().createInstance("com.sun.star.sdb.DatabaseContext"));
            dataSourceRegistrations.registerObject("someDataSource", m_dataSource.getXDataSource());

            assureEquals( "registration name of a newly registered data source is wrong",
                dataSourceName, m_dataSource.getName() );
        }
        catch ( AssureException e ) { throw e; }
View Full Code Here

Examples of com.sun.star.uno.XNamingService

      rComponent.dispose();
    }
  }

  static void doSomething(Object r) throws com.sun.star.uno.Exception, IOException {
    XNamingService rName = (XNamingService)UnoRuntime.queryInterface(XNamingService.class, r);

    if(rName != null) {
      System.err.println("got the remote naming service !");
      Object rXsmgr = rName.getRegisteredObject("StarOffice.ServiceManager");
     
      XMultiServiceFactory rSmgr = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, rXsmgr);
      if(rSmgr != null) {
        System.err.println("got the remote service manager !");
//          testPipe(rSmgr);
View Full Code Here

Examples of com.sun.star.uno.XNamingService

        XMultiComponentFactory xMultiComponentFactory = getMultiComponentFactory();
        // create a connector, so that it can contact the office
        Object xUrlResolver = xMultiComponentFactory.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", xcomponentcontext);
        XUnoUrlResolver urlResolver = (XUnoUrlResolver) UnoRuntime.queryInterface(XUnoUrlResolver.class, xUrlResolver);
        Object rInitialObject = urlResolver.resolve(connectStr);
        XNamingService rName = (XNamingService) UnoRuntime.queryInterface(XNamingService.class, rInitialObject);
        XMultiServiceFactory xMSF = null;
        if (rName != null) {
            System.err.println("got the remote naming service !");
            Object rXsmgr = rName.getRegisteredObject("StarOffice.ServiceManager");
            xMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, rXsmgr);
        }
        return (xMSF);
    }
View Full Code Here

Examples of com.sun.star.uno.XNamingService

    {
      System.err.println("got the remote object");
      System.out.println("before naming service !");
      try
      {
        XNamingService rName = (XNamingService)UnoRuntime.queryInterface(XNamingService.class, rInitialObject );
        try
        {
          if(rName != null)
          {
            System.err.println("got the remote naming service !");
            Object rXsmgr = rName.getRegisteredObject("StarOffice.ServiceManager");
            XMultiServiceFactory rSmgr = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, rXsmgr);
            if(rSmgr != null)
            {
              System.out.println("got the remote service manager !");
              Object rDriver = rSmgr.createInstance("com.sun.star.sdbc.ADriver");
View Full Code Here

Examples of com.sun.star.uno.XNamingService

    {
        m_orb = (XMultiServiceFactory)param.getMSF();

        XNameAccess databaseContext = (XNameAccess)UnoRuntime.queryInterface( XNameAccess.class,
            m_orb.createInstance( "com.sun.star.sdb.DatabaseContext" ) );
        XNamingService namingService = (XNamingService)UnoRuntime.queryInterface( XNamingService.class,
            databaseContext );

        // revoke the data source, if it previously existed
        if ( databaseContext.hasByName( m_dataSourceName ) )
            namingService.revokeObject( m_dataSourceName );

        // // create a new ODB file, and register it with its URL
        m_databaseDocument = new HsqlDatabase( m_orb );
        String documentURL = m_databaseDocument.getDocumentURL();
        namingService.registerObject( m_dataSourceName, databaseContext.getByName( documentURL ) );

        m_dataSource = (XDataSource)UnoRuntime.queryInterface( XDataSource.class,
            databaseContext.getByName( m_dataSourceName ) );
        m_dataSourceProps = dbfTools.queryPropertySet( m_dataSource );
        return m_dataSource != null;
View Full Code Here

Examples of com.sun.star.uno.XNamingService

        XMultiComponentFactory xMultiComponentFactory = getMultiComponentFactory();
        // create a connector, so that it can contact the office
        Object xUrlResolver = xMultiComponentFactory.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", xcomponentcontext);
        XUnoUrlResolver urlResolver = (XUnoUrlResolver) UnoRuntime.queryInterface(XUnoUrlResolver.class, xUrlResolver);
        Object rInitialObject = urlResolver.resolve(connectStr);
        XNamingService rName = (XNamingService) UnoRuntime.queryInterface(XNamingService.class, rInitialObject);
        XMultiServiceFactory xMSF = null;
        if (rName != null)
        {
            System.err.println("got the remote naming service !");
            Object rXsmgr = rName.getRegisteredObject("StarOffice.ServiceManager");
            xMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, rXsmgr);
        }
        return (xMSF);
    }
View Full Code Here

Examples of com.sun.star.uno.XNamingService

            String dataSourceName = "Bibliography";
            final connectivity.tools.DataSource bibliography = new connectivity.tools.DataSource(getFactory(), dataSourceName);
            assureEquals("pre-registered database has a wrong name!", dataSourceName, bibliography.getName());
            // 2. register a newly created data source, and verify it has the proper name
            dataSourceName = "someDataSource";
            final XNamingService dataSourceRegistrations = (XNamingService) UnoRuntime.queryInterface(
                    XNamingService.class, getFactory().createInstance("com.sun.star.sdb.DatabaseContext"));
            dataSourceRegistrations.registerObject("someDataSource", m_dataSource.getXDataSource());
            assureEquals("registration name of a newly registered data source is wrong", dataSourceName, m_dataSource.getName());
        }
        catch (Exception ex)
        {
            Logger.getLogger(DataSource.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here

Examples of com.sun.star.uno.XNamingService

      rComponent.dispose();
    }
  }

  static void doSomething(Object r) throws com.sun.star.uno.Exception, IOException {
    XNamingService rName = UnoRuntime.queryInterface(XNamingService.class, r);

    if(rName != null) {
      System.err.println("got the remote naming service !");
      Object rXsmgr = rName.getRegisteredObject("StarOffice.ServiceManager");
     
      XMultiServiceFactory rSmgr = UnoRuntime.queryInterface(XMultiServiceFactory.class, rXsmgr);
      if(rSmgr != null) {
        System.err.println("got the remote service manager !");
//          testPipe(rSmgr);
View Full Code Here

Examples of com.sun.star.uno.XNamingService

        UnoRuntime.queryInterface( XUnoUrlResolver.class,
        objectUrlResolver );
       
        Object rInitialObject = xurlresolver.resolve( connectStr );

        XNamingService rName = (XNamingService)UnoRuntime.queryInterface(
            XNamingService.class, rInitialObject );
       
        XMultiServiceFactory xMSF = null;
        if( rName != null ) {
            System.err.println( "got the remote naming service !" );
            Object rXsmgr = rName.getRegisteredObject("StarOffice.ServiceManager" );
           
            xMSF = (XMultiServiceFactory)
            UnoRuntime.queryInterface( XMultiServiceFactory.class, rXsmgr );
        }
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.