Package org.apache.ws.resource.discovery.impl

Examples of org.apache.ws.resource.discovery.impl.DiscoveryAgentProperty


                         RegistrationManager      registrationManager,
                         DiscoveryAgentProperty[] agentProps )
   {
      // Here we use a property in the XML discover description.
      String resourceId = DEFAULT_ID;
      DiscoveryAgentProperty agentProp = agentProps[0];
      if ( agentProp.getId(  ).equals( "ResourceID" ) )
      {
         resourceId = agentProp.getValue(  );     
      }

      try
      {
         // Create and register an instance of the Template service.
View Full Code Here


    */
   public void testDiscover(  )
   {
      testPass = false;
      DiskDiscoveryAgent       dda   = new DiskDiscoveryAgent(  );
      DiscoveryAgentProperty   prop1 = new DiscoveryAgentProperty( "ResourceID", "1234" );
      DiscoveryAgentProperty[] props = new DiscoveryAgentProperty[]
                                       {
                                          prop1
                                       };
      dda.discover( "Unit Test Agent", this, props );
View Full Code Here

      // See how many agentProps there are with ResourceID
      // For each one, create a DiskResource and register it
      int discoveredCount = 0;
      for ( int i = 0; i < agentProps.length; i++ )
      {
         DiscoveryAgentProperty agentProp = agentProps[i];
         if ( agentProp.getId(  ).equals( "ResourceID" ) )
         {
            DiskWsdmServiceWSResource resource = null;
            try
            {
               String resourceId = agentProp.getValue(  );
               resource = new DiskWsdmServiceWSResource( resourceId );
               resource.getPropertiesManager(  ).setReadOnly( ExampleConstants.RESOURCE_PROP_QNAME_CAPACITY, true );
               discoveredCount++;
            }
            catch ( Throwable t )
            {
               LOG.error( "Discovery failed for DiskWsdmServiceWSResource with Id " + agentProp.getId(  ), t );
               continue;
            }

            LOG.info( "Attempting to register an instance of DiskWsdmServiceWSResource ResourceID="
                      + agentProp.getValue(  ) );
            try
            {
               registrationManager.register( resource );
            }
            catch ( RegistrationFailureException rfe )
            {
               LOG.error( "Discovery failed to register " + agentProp.getId(  ), rfe );
            }
         }
      }

      //Just for conveniance, if nothing was discovered, write that to the log.
View Full Code Here

TOP

Related Classes of org.apache.ws.resource.discovery.impl.DiscoveryAgentProperty

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.