Package com.sun.star.bridge

Examples of com.sun.star.bridge.XUnoUrlResolver


            Object objectUrlResolver =
                xmulticomponentfactory.createInstanceWithContext(
                    "com.sun.star.bridge.UnoUrlResolver", xcomponentcontext );
           
            // Create a new url resolver
            XUnoUrlResolver xurlresolver = ( XUnoUrlResolver )
                UnoRuntime.queryInterface( XUnoUrlResolver.class,
                                           objectUrlResolver );
     
            // Resolves an object that is specified as follow:
            // uno:<connection description>;<protocol description>;<initial object name>
            Object objectInitial = xurlresolver.resolve(
                "uno:socket,host=" + stringHost + ",port=" + stringPort +
                ";urp;StarOffice.ServiceManager" );
           
            // Create a service manager from the initial object
            xmulticomponentfactory = ( XMultiComponentFactory )
View Full Code Here


        XMultiComponentFactory xLocalServiceManager = xComponentContext.getServiceManager();
               
        // create a connector, so that it can contact the office
        Object  oUrlResolver  = xLocalServiceManager.createInstanceWithContext( "com.sun.star.bridge.UnoUrlResolver",
                                        xComponentContext );
        XUnoUrlResolver xUrlResolver = (XUnoUrlResolver)UnoRuntime.queryInterface( XUnoUrlResolver.class, oUrlResolver );
       
        Object oInitialObject = xUrlResolver.resolve( sConnectionString );
        XNamingService xName = (XNamingService)UnoRuntime.queryInterface( XNamingService.class, oInitialObject );
       
        XMultiServiceFactory xMSF = null;
        if( xName != null ) {
            Object oMSF = xName.getRegisteredObject( "StarOffice.ServiceManager" );
View Full Code Here

    {
        XComponentContext xcomponentcontext = null;
        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 !");
View Full Code Here

        // create a urlresolver
        Object urlResolver  = xLocalServiceManager.createInstanceWithContext(
            "com.sun.star.bridge.UnoUrlResolver", xLocalContext );

        // query for the XUnoUrlResolver interface
        XUnoUrlResolver xUrlResolver =
            (XUnoUrlResolver) UnoRuntime.queryInterface( XUnoUrlResolver.class, urlResolver );

        try
        {
            // Import the object
            Object rInitialObject = xUrlResolver.resolve( args[0] );

            // XComponentContext
            if( null != rInitialObject )
            {
                System.out.println( "initial object successfully retrieved" );
View Full Code Here

    XMultiServiceFactory xLocalServiceManager =
      com.sun.star.comp.helper.Bootstrap.createSimpleServiceManager();

    // create a connector, so that it can contact the office
    Object  xUrlResolver  = xLocalServiceManager.createInstance( "com.sun.star.bridge.UnoUrlResolver" );
    XUnoUrlResolver urlResolver = (XUnoUrlResolver)UnoRuntime.queryInterface(
            XUnoUrlResolver.class, xUrlResolver );

    Object rInitialObject = urlResolver.resolve( "uno:" + connectStr + ";urp;StarOffice.NamingService" );

    XNamingService rName = (XNamingService)UnoRuntime.queryInterface(
            XNamingService.class, rInitialObject );

    XMultiServiceFactory xMSF = null;
View Full Code Here

        try
        {
            //  Create a URL Resolver.
            XMultiServiceFactory aLocalServiceManager =
                Bootstrap.createSimpleServiceManager();
            XUnoUrlResolver aURLResolver =
        (XUnoUrlResolver) UnoRuntime.queryInterface (
          XUnoUrlResolver.class,
          aLocalServiceManager.createInstance (
            "com.sun.star.bridge.UnoUrlResolver")
          );
           
            maServiceManager =
        (XMultiServiceFactory) UnoRuntime.queryInterface (
                    XMultiServiceFactory.class,
                    aURLResolver.resolve (sConnectString)
                    );
        }

        catch (Exception e)
        {
View Full Code Here

    XMultiServiceFactory xLocalServiceManager =
      com.sun.star.comp.helper.Bootstrap.createSimpleServiceManager();

    // create a connector, so that it can contact the office
    Object  xUrlResolver  = xLocalServiceManager.createInstance( "com.sun.star.bridge.UnoUrlResolver" );
    XUnoUrlResolver urlResolver = (XUnoUrlResolver)UnoRuntime.queryInterface(
            XUnoUrlResolver.class, xUrlResolver );

    Object rInitialObject = urlResolver.resolve( "uno:" + connectStr + ";urp;StarOffice.NamingService" );

    XNamingService rName = (XNamingService)UnoRuntime.queryInterface(
            XNamingService.class, rInitialObject );

    XMultiServiceFactory xMSF = null;
View Full Code Here

        xComponentContext.getServiceManager();
               
        // create a connector, so that it can contact the office
        Object  oUrlResolver  = xLocalServiceManager.createInstanceWithContext(
        "com.sun.star.bridge.UnoUrlResolver", xComponentContext );
        XUnoUrlResolver xUrlResolver = (XUnoUrlResolver)UnoRuntime.queryInterface(
            XUnoUrlResolver.class, oUrlResolver );
       
        Object oInitialObject = xUrlResolver.resolve( sConnectStr );
        XNamingService xName = (XNamingService)UnoRuntime.queryInterface(
            XNamingService.class, oInitialObject );
       
        XMultiServiceFactory xMSF = null;
        if( xName != null ) {
View Full Code Here

        try
        {
            //  Create a URL Resolver.
            XMultiServiceFactory aLocalServiceManager =
                Bootstrap.createSimpleServiceManager();
            XUnoUrlResolver aURLResolver =
        (XUnoUrlResolver) UnoRuntime.queryInterface (
          XUnoUrlResolver.class,
          aLocalServiceManager.createInstance (
            "com.sun.star.bridge.UnoUrlResolver")
          );
           
            maServiceManager =
        (XMultiServiceFactory) UnoRuntime.queryInterface (
                    XMultiServiceFactory.class,
                    aURLResolver.resolve (sConnectString)
                    );
        }

        catch (Exception e)
        {
View Full Code Here

        if (UtilValidate.isEmpty(port)) port = UtilProperties.getPropertyValue("openoffice-uno", "oo.port", "8100");
       
        XMultiComponentFactory xmulticomponentfactory = null;
        XComponentContext xcomponentcontext = null;
        Object objectUrlResolver = null;
        XUnoUrlResolver xurlresolver = null;
        Object objectInitial = null;
        // Converting the document to the favoured type
        try {
            /* Bootstraps a component context with the jurt base components
            registered. Component context to be granted to a component for running.
            Arbitrary values can be retrieved from the context. */
            xcomponentcontext = com.sun.star.comp.helper.Bootstrap.createInitialComponentContext(null);
        
            /* Gets the service manager instance to be used (or null). This method has
            been added for convenience, because the service manager is a often used
            object. */
            xmulticomponentfactory = xcomponentcontext.getServiceManager();
        
            /* Creates an instance of the component UnoUrlResolver which
            supports the services specified by the factory. */
            objectUrlResolver = xmulticomponentfactory.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", xcomponentcontext);
        
            // Create a new url resolver
            xurlresolver = (XUnoUrlResolver) UnoRuntime.queryInterface(XUnoUrlResolver.class, objectUrlResolver);
        
            // Resolves an object that is specified as follow:
            // uno:<connection description>;<protocol description>;<initial object name>
            String url = "uno:socket,host=" + host + ",port=" + port + ";urp;StarOffice.ServiceManager";
            objectInitial = xurlresolver.resolve(url);
        
            // Create a service manager from the initial object
            xmulticomponentfactory = (XMultiComponentFactory) UnoRuntime.queryInterface(XMultiComponentFactory.class, objectInitial);
        } catch(Exception e) {
            // TODO: None of this works. Need a programmable start solution.
View Full Code Here

TOP

Related Classes of com.sun.star.bridge.XUnoUrlResolver

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.