Examples of ConfigurationContext


Examples of org.apache.axis2.context.ConfigurationContext

     *      QName, Class)
     */
    public static ServiceDescription createServiceDescription(URL wsdlURL,
                                                              QName serviceQName,
                                                              Class serviceClass) {
        ConfigurationContext configContext = DescriptionFactory.createClientConfigurationFactory()
                .getClientConfigurationContext();
        DescriptionKey key = new DescriptionKey(serviceQName, wsdlURL, serviceClass, configContext);
        if (log.isDebugEnabled()) {
            log.debug("Cache Map = " + cache.toString());
            if (key != null)
View Full Code Here

Examples of org.apache.axis2.context.ConfigurationContext

     * Loads up a ConfigurationContext object using the configuration builder.
     *
     * @return a ConfigurationContext object that is suitable for the client environment
     */
    public synchronized ConfigurationContext getClientConfigurationContext() {
        ConfigurationContext configContext = null;
        //TODO: Add logging
        String repoPath = System.getProperty(Constants.AXIS2_REPO_PATH);
        String axisConfigPath = System.getProperty(Constants.AXIS2_CONFIG_PATH);
        try {
            configContext = ConfigurationContextFactory
View Full Code Here

Examples of org.apache.axis2.context.ConfigurationContext

    }

    public ServiceClient getServiceClient() {
        try {
            if (serviceClient == null) {
                ConfigurationContext configCtx = getServiceDescription().getAxisConfigContext();
                AxisService axisSvc = getAxisService();
                AxisConfiguration axisCfg = configCtx.getAxisConfiguration();
                if (axisCfg.getService(axisSvc.getName()) != null) {
                    axisSvc.setName(axisSvc.getName() + this.hashCode());
                }
                serviceClient = new ServiceClient(configCtx, axisSvc);
            }
View Full Code Here

Examples of org.apache.axis2.context.ConfigurationContext

    public void doService2(
            final Request request,
            final Response response,
            final MessageContext msgContext) throws Exception {

        ConfigurationContext configurationContext = msgContext.getConfigurationContext();
        final String servicePath = configurationContext.getServiceContextPath();
        final String contextPath = (servicePath.startsWith("/") ? servicePath : "/" + servicePath) + "/";

        URI uri = request.getURI();
        String path = uri.getPath();
        String soapAction = request.getHeader(HTTPConstants.HEADER_SOAP_ACTION);
       
        HashMap services = configurationContext.getAxisConfiguration().getServices();
        AxisService service = null;
        String serviceName = null;
       
        if(services.size() == 1){
          service = (AxisService)(services.values().iterator().next());
View Full Code Here

Examples of org.apache.axis2.context.ConfigurationContext

    String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
   
    String repoPath = "target" + File.separator + "repos" + File.separator + "client";
    String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
   
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);

    Options clientOptions = new Options ();
    clientOptions.setAction(echoAction);
    clientOptions.setTo(new EndpointReference (to));

    //setting the SOAP version as 1.2
    if (runSoap12)
      clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);

    String sequenceKey = SandeshaUtil.getUUID();
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
   
    ServiceClient serviceClient = new ServiceClient (configContext,null);
   
    // Set a bad acks to so the CreateSequence will be refused.
    String acksTo = AddressingConstants.Final.WSA_NONE_URI;
    clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
   
    clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    clientOptions.setUseSeparateListener(true);   
    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
    serviceClient.setOptions(clientOptions);   
   
    TestCallback callback1 = new TestCallback ("Callback 1");
    serviceClient.sendReceiveNonBlocking (getEchoOMBlock("echo1",sequenceKey),callback1);
       
    long limit = System.currentTimeMillis() + waitTime;
    Error lastError = null;
    while(System.currentTimeMillis() < limit) {
      Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
     
      try {
            //assertions for the out sequence.
        SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
        assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
        assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
       
        assertTrue(callback1.isErrorReported());
        assertEquals(callback1.getResult(),null);
       
        lastError = null;
        break;
      } catch(Error e) {
        lastError = e;
      }
    }

    if(lastError != null) throw lastError;

    configContext.getListenerManager().stop();
    serviceClient.cleanup();

  }
View Full Code Here

Examples of org.apache.axis2.context.ConfigurationContext

    String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";
   
    String repoPath = "target" + File.separator + "repos" + File.separator + "client";
    String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
   
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);   
   
    Options clientOptions = new Options ();
    clientOptions.setAction(pingAction);
    clientOptions.setTo(new EndpointReference (to));
    clientOptions.setFaultTo(new EndpointReference(AddressingConstants.Final.WSA_ANONYMOUS_URL));

    String sequenceKey = SandeshaUtil.getUUID();
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
    clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1);
   
    if (soap12)
      clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
   
    ServiceClient serviceClient = new ServiceClient (configContext,null);
    serviceClient.setOptions(clientOptions);

    // Send a single ping message
    serviceClient.fireAndForget(getPingOMBlock("ping1"));
 
    long limit = System.currentTimeMillis() + waitTime;
    Error lastError = null;
    while(System.currentTimeMillis() < limit) {
      Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
     
      // Check that the sequence has been deleted.
      StorageManager storageManager =
        SandeshaUtil.getSandeshaStorageManager(serverConfigContext, serverConfigContext.getAxisConfiguration());
     
      Transaction tran = storageManager.getTransaction();
     
      RMDBean finderBean = new RMDBean();
      finderBean.setTerminated(false);
      List rmdBeans = storageManager.getRMDBeanMgr().find(finderBean);
     
      tran.commit();
     
      lastError = null;
     
      if (rmdBeans.isEmpty())
        lastError = new Error("rmdBeans empty " + rmdBeans);
      else {
        RMDBean bean = (RMDBean)rmdBeans.get(0);
        if (!bean.getServerCompletedMessages().getContainedElementsAsNumbersList().contains(new Integer(1))) {
          tran = storageManager.getTransaction();
          if (deleteRMSBean) {
            storageManager.getRMDBeanMgr().delete(bean.getSequenceID());
          } else {
            bean.setTerminated(true);
            storageManager.getRMDBeanMgr().update(bean);
          }
          tran.commit();
          break;       
        }
       
        lastError = new Error("App message has not arrived");
      }
    }

    if(lastError != null) throw lastError;

    // Send a second application message.
    serviceClient.fireAndForget(getPingOMBlock("ping2"));
   
    while(System.currentTimeMillis() < limit) {
      Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
     
      try {
        //Check that the outgoing sequence is terminated
        SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
        assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
        assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
       
        lastError = null;
        break;
      } catch(Error e) {
        lastError = e;
      }
    }

    if(lastError != null) throw lastError;
   
    configContext.getListenerManager().stop();
    serviceClient.cleanup();

  }
View Full Code Here

Examples of org.apache.axis2.context.ConfigurationContext

        Parameter parameter = new Parameter ();
        parameter.setName(Sandesha2Constants.SANDESHA_PROPERTY_BEAN);
        parameter.setValue(propertyBean);
        axisConfig.addParameter(parameter);
       
        ConfigurationContext configCtx = new ConfigurationContext(axisConfig);
       
        ClassLoader classLoader = getClass().getClassLoader();
        parameter = new Parameter(Sandesha2Constants.MODULE_CLASS_LOADER,classLoader);
        axisConfig.addParameter(parameter);
       
View Full Code Here

Examples of org.apache.axis2.context.ConfigurationContext

        Parameter parameter = new Parameter ();
        parameter.setName(Sandesha2Constants.SANDESHA_PROPERTY_BEAN);
        parameter.setValue(propertyBean);
        axisConfig.addParameter(parameter);
       
        ConfigurationContext configCtx = new ConfigurationContext(axisConfig);
       
        ClassLoader classLoader = getClass().getClassLoader();
        parameter = new Parameter(Sandesha2Constants.MODULE_CLASS_LOADER,classLoader);
        axisConfig.addParameter(parameter);
       
View Full Code Here

Examples of org.apache.axis2.context.ConfigurationContext

  public void testKeyConflicts ()  throws AxisFault {
   
    try {
      AxisConfiguration axisConfiguration = new AxisConfiguration ();
      ConfigurationContext configurationContext = new ConfigurationContext (axisConfiguration);
     
      //setting a dummy property been to stop Sandesha2 from throwing exceptions.
      SandeshaPolicyBean policyBean = new SandeshaPolicyBean ();
      axisConfiguration.addParameter(new Parameter (Sandesha2Constants.SANDESHA_PROPERTY_BEAN,policyBean));
     
View Full Code Here

Examples of org.apache.axis2.context.ConfigurationContext

        Parameter parameter = new Parameter ();
        parameter.setName(Sandesha2Constants.SANDESHA_PROPERTY_BEAN);
        parameter.setValue(propertyBean);
        axisConfig.addParameter(parameter);
       
        ConfigurationContext configCtx = new ConfigurationContext(axisConfig);
       
        ClassLoader classLoader = getClass().getClassLoader();
        parameter = new Parameter(Sandesha2Constants.MODULE_CLASS_LOADER,classLoader);
        axisConfig.addParameter(parameter);
       
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.