Package org.apache.ws.resource

Examples of org.apache.ws.resource.WSResource


    *
    */
   public void testGetResourceId(  )
   throws Exception
   {
      WSResource resource =
         new ClientProxyWSResource( ClientProxyWSResource.createEndpointReference( getAxisWebServiceUrl( ExampleConstants.SERVICE_NAME ),
                                                                                   RESOURCE_ID ) );
      SOAPElement[] responseElems =
         resource.getResourceProperty( Muws05Constants.RESOURCE_PROP_QNAME_RESOURCE_ID );
      assertNotNull( responseElems );
      assertTrue( responseElems.length == 1 );
      SOAPElement responseElem = responseElems[0];
      assertEquals( ResourceProperties11Constants.NSURI_WSRP,
                    responseElem.getNamespaceURI(  ) );
View Full Code Here


            WSResource[] resources = m_registrationManager.find( null );

            // loop through all resources found in the manager, stop if our thread has been told to shutdown
            for ( int i = 0; ( i < resources.length ) && m_started; i++ )
            {
               final WSResource resource = resources[i];

               // only examine termination time if we have not seen this resource before or we have and it supports WS-RL TerminationTime
               if ( !m_noTerminationTimeSupport.containsKey( resource.getId(  ) ) )
               {
                  // tell the thread pool to run code that examines the current resource and destroys it if it is expired
                  m_reaperThreadPool.execute( new Runnable(  )
                     {
                        public void run(  )
                        {
                           TerminationTimeDocument termTimeXmlBean = null;

                           try
                           {
                              SOAPElement[] soapEle =
                                              resource.getResourceProperty( ResourceLifetime11Constants.RESOURCE_PROP_QNAME_TERMINATION_TIME );

                              termTimeXmlBean = (TerminationTimeDocument) XmlBeansUtils.toXmlObject( soapEle[0] );
                           }
                           catch ( Throwable t )
                           {
                              m_noTerminationTimeSupport.put( resource.getId(  ),
                                                              resource.getId(  ) );
                           }

                           if ( ( termTimeXmlBean != null )
                                && !termTimeXmlBean.isNilTerminationTime(  )
                                && termTimeXmlBean.getTerminationTime(  ).before( Calendar.getInstance(  ) ) )
                           {
                              try
                              {
                                 resource.destroy(  );
                              }
                              catch ( Exception destroyException )
                              {
                                 // TODO: what should we do if we failed to destroy an expired resource?
                                 //destroyException.printStackTrace(  );
View Full Code Here

   public boolean handleRequest( MessageContext msgContext )
   {
      // Do this first so we get the full MessageContext
      boolean    returnValue = super.handleRequest( msgContext );

      WSResource target = null;

      try
      {
         target =
            RegistrationManagerFactory.getManager(  ).find( AxisUtils.getServiceName( msgContext ),
View Full Code Here

         results = new WSResource[0];
      }
      EndpointReferenceType[] eprList = new EndpointReferenceType[results.length];
      for ( int i = 0; i < results.length; i++ )
      {
         WSResource resource = results[i];
         eprList[i] = resource.getEndpointReference( );
      }
      return new axis.org.apache.ws.generated.registry.FindResponse( eprList );
   }
View Full Code Here

   /**
    * Implementation of the WSDL operation named <code>findResource</code>.
    */
   public org.apache.axis.message.addressing.EndpointReferenceType findResource(axis.org.apache.ws.generated.registry.FindResourceRequest findResourceRequest) throws java.rmi.RemoteException
   {
      WSResource result = getRegistrationManager().find( findResourceRequest.getServiceName( ), findResourceRequest.getId( ) );
      return result.getEndpointReference( );
   }
View Full Code Here

TOP

Related Classes of org.apache.ws.resource.WSResource

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.