Package com.arjuna.webservices11

Examples of com.arjuna.webservices11.ServiceRegistry


     */
    public void contextInitialized(final ServletContextEvent servletContextEvent)
    {
        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
           public void run() {
               final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
               String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
               String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
               String secureBindPort = System.getProperty(Environment.XTS_SECURE_BIND_PORT);

               if (bindAddress == null) {
                   bindAddress = "127.0.0.1";
               }

               if (bindPort == null) {
                   bindPort = "8080";
               }

               if (secureBindPort == null) {
                   secureBindPort = "8443";
               }

               final String baseUri = "http://" +  bindAddress + ":" + bindPort + "/ws-t11/";
               final String uri = baseUri + AtomicTransactionConstants.COORDINATOR_SERVICE_NAME;
               final String secureBaseUri = "https://" +  bindAddress + ":" + secureBindPort + "/ws-t11/";
               final String secureUri = secureBaseUri + AtomicTransactionConstants.COORDINATOR_SERVICE_NAME;

               serviceRegistry.registerServiceProvider(AtomicTransactionConstants.COORDINATOR_SERVICE_NAME, uri) ;
               serviceRegistry.registerSecureServiceProvider(AtomicTransactionConstants.COORDINATOR_SERVICE_NAME, secureUri) ;
           }
        };
    }
View Full Code Here


     */
    public void contextInitialized(final ServletContextEvent servletContextEvent)
    {
        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
           public void run() {
               final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
               String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
               String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
               String secureBindPort = System.getProperty(Environment.XTS_SECURE_BIND_PORT);

               if (bindAddress == null) {
                   bindAddress = "127.0.0.1";
               }

               if (bindPort == null) {
                   bindPort = "8080";
               }

               if (secureBindPort == null) {
                   secureBindPort = "8443";
               }

               final String baseUri = "http://" +  bindAddress + ":" + bindPort + "/ws-t11/";
               final String uri = baseUri + BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME;
               final String secureBaseUri = "https://" +  bindAddress + ":" + secureBindPort + "/ws-t11/";
               final String secureUri = secureBaseUri + BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME;

               serviceRegistry.registerServiceProvider(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME, uri) ;
               serviceRegistry.registerSecureServiceProvider(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME, secureUri) ;
           }
        };
    }
View Full Code Here

     */
    public void contextInitialized(final ServletContextEvent servletContextEvent)
    {
        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
           public void run() {
               final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
               String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
               String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
               String secureBindPort = System.getProperty(Environment.XTS_SECURE_BIND_PORT);

               if (bindAddress == null) {
                   bindAddress = "127.0.0.1";
               }

               if (bindPort == null) {
                   bindPort = "8080";
               }

               if (secureBindPort == null) {
                   secureBindPort = "8443";
               }

               final String baseUri = "http://" +  bindAddress + ":" + bindPort + "/ws-t11/";
               final String uri = baseUri + BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME;
               final String secureBaseUri = "https://" +  bindAddress + ":" + secureBindPort + "/ws-t11/";
               final String secureUri = secureBaseUri + BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME;

               serviceRegistry.registerServiceProvider(BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME, uri) ;
               serviceRegistry.registerSecureServiceProvider(BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME, secureUri) ;
           }
        };
    }
View Full Code Here

    {
        if (coordinationTypeURI.equals(TestUtil.INVALID_CREATE_PARAMETERS_COORDINATION_TYPE)) {
            throw new InvalidCreateParametersException();
        }

        final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
        final String registrationURI = serviceRegistry.getServiceURI(CoordinationConstants.REGISTRATION_SERVICE_NAME) ;
        final W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
        builder.serviceName(CoordinationConstants.REGISTRATION_SERVICE_QNAME);
        builder.endpointName(CoordinationConstants.REGISTRATION_ENDPOINT_QNAME);
        builder.address(registrationURI);
        W3CEndpointReference registrationService = builder.build();
View Full Code Here

             * implementation.
             */

            if (_activationCoordinatorService == null)
            {
                final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
                _activationCoordinatorService = serviceRegistry.getServiceURI(CoordinationConstants.ACTIVATION_SERVICE_NAME) ;
            }
        }
        catch (Exception ex)
        {
            // TODO
View Full Code Here

                }

        _coordManager.begin(timeout);

                final ArjunaContextImple arjunaContext = ArjunaContextImple.getContext() ;
                final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
                final String registrationCoordinatorURI = serviceRegistry.getServiceURI(CoordinationConstants.REGISTRATION_SERVICE_NAME, isSecure) ;

                final CoordinationContext coordinationContext = new CoordinationContext() ;
                coordinationContext.setCoordinationType(coordinationTypeURI);
                CoordinationContextType.Identifier identifier = new CoordinationContextType.Identifier();
                identifier.setValue("urn:"+arjunaContext.getTransactionIdentifier());
                coordinationContext.setIdentifier(identifier) ;
                final int transactionExpires = arjunaContext.getTransactionExpires();
                if (transactionExpires > 0)
                {
                    Expires expiresInstance = new Expires();
                    expiresInstance.setValue(transactionExpires);
                    coordinationContext.setExpires(expiresInstance);
                }
                W3CEndpointReference registrationCoordinator = getRegistrationCoordinator(registrationCoordinatorURI, arjunaContext);
                coordinationContext.setRegistrationService(registrationCoordinator) ;

        /*
         * Now add the registrar for this specific coordinator to the
         * mapper.
         */

        _coordManager.enlistSynchronization(new CleanupSynchronization(_coordManager.identifier().toString(), _theRegistrar));

        /*
         * TODO Uughh! This does a suspend for us! Left over from original
         * WS-AS stuff.
         *
         * TODO
         * REFACTOR, REFACTOR, REFACTOR.
         */

        _theRegistrar.associate();

        return coordinationContext;
                } else {
                    // we need to create a subordinate transaction and register it as both a durable and volatile
                    // participant with the registration service defined in the current context

                    SubordinateCoordinator subTx = (SubordinateCoordinator) createSubordinate();
                    // hmm, need to create wrappers here as the subTx is in WSCF which only knows
                    // about WSAS and WS-C and the participant is in WS-T
                    String vtppid = subTx.getVolatile2PhaseId();
                    String dtppid = subTx.getDurable2PhaseId();
                    Volatile2PCParticipant vtpp = new SubordinateVolatile2PCStub(subTx);
                    Durable2PCParticipant dtpp = new SubordinateDurable2PCStub(subTx);
                    final String messageId = MessageId.getMessageId() ;
                    W3CEndpointReference participant;
                    W3CEndpointReference coordinator;
                    participant= getParticipant(vtppid, isSecure);
                    coordinator = RegistrationCoordinator.register(currentContext, messageId, participant, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC) ;
                    ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(vtpp, vtppid, coordinator), vtppid) ;
                    participant= getParticipant(dtppid, isSecure);
                    coordinator = RegistrationCoordinator.register(currentContext, messageId, participant, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC) ;
                    ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(dtpp, dtppid, coordinator), dtppid) ;

                    // ok now create the context
                    final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
                    final String registrationCoordinatorURI = serviceRegistry.getServiceURI(CoordinationConstants.REGISTRATION_SERVICE_NAME, isSecure) ;

                    final CoordinationContext coordinationContext = new CoordinationContext() ;
                    coordinationContext.setCoordinationType(coordinationTypeURI);
                    CoordinationContextType.Identifier identifier = new CoordinationContextType.Identifier();
                    String txId = subTx.get_uid().stringForm();
View Full Code Here

            return null;
        }

        // ok now create the context

        final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
        final String registrationCoordinatorURI = serviceRegistry.getServiceURI(CoordinationConstants.REGISTRATION_SERVICE_NAME, isSecure) ;

        final CoordinationContext coordinationContext = new CoordinationContext() ;
        coordinationContext.setCoordinationType(AtomicTransactionConstants.WSAT_PROTOCOL);
        CoordinationContextType.Identifier identifier = new CoordinationContextType.Identifier();
        String txId = subTx.get_uid().stringForm();
View Full Code Here

       * implementation.
       */

      if (_activationCoordinatorService == null)
      {
                final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
                _activationCoordinatorService = serviceRegistry.getServiceURI(CoordinationConstants.ACTIVATION_SERVICE_NAME) ;
      }
    }
    catch (Exception ex)
    {
      // TODO
View Full Code Here

     * @param id The completion id.
     * @return The endpoint reference.
     */
    private static W3CEndpointReference getCompletionParticipant(final String id)
    {
        final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
        final String serviceURI = serviceRegistry.getServiceURI(AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME) ;
        final W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
        builder.serviceName(AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_QNAME);
        builder.endpointName(AtomicTransactionConstants.COMPLETION_INITIATOR_PORT_QNAME);
        builder.address(serviceURI);
        InstanceIdentifier.setEndpointInstanceIdentifier(builder, id) ;
View Full Code Here

     * @param id The participant id.
     * @return The endpoint reference.
     */
    private static W3CEndpointReference getParticipant(final String id)
    {
        final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
        final String serviceURI = serviceRegistry.getServiceURI(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME) ;
        final W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
        builder.serviceName(AtomicTransactionConstants.PARTICIPANT_SERVICE_QNAME);
        builder.endpointName(AtomicTransactionConstants.PARTICIPANT_PORT_QNAME);
        builder.address(serviceURI);
        InstanceIdentifier.setEndpointInstanceIdentifier(builder, id) ;
View Full Code Here

TOP

Related Classes of com.arjuna.webservices11.ServiceRegistry

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.