Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 65132 Details for
Bug 167535
MAX tries to do a getResourcePropertyDocument when establishing a connection
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Do MEX or look for SG specific property instead of doing getResourcePropertyDocument
167535.patch (text/plain), 7.74 KB, created by
Balan Subramanian
on 2007-04-26 20:35:08 EDT
(
hide
)
Description:
Do MEX or look for SG specific property instead of doing getResourcePropertyDocument
Filename:
MIME Type:
Creator:
Balan Subramanian
Created:
2007-04-26 20:35:08 EDT
Size:
7.74 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.monitoring.managedagent.wsdm.muse >Index: src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/messages.properties >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.tptp.monitoring.managedagent.wsdm.muse/src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/messages.properties,v >retrieving revision 1.3 >diff -u -r1.3 messages.properties >--- src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/messages.properties 21 Mar 2007 21:30:17 -0000 1.3 >+++ src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/messages.properties 27 Apr 2007 00:35:44 -0000 >@@ -13,7 +13,8 @@ > # NLS_MESSAGEFORMAT_VAR > # NLS_ENCODING=UTF-8 > >-MuseRuntime.CANT_CONN.ERROR.=IWAT0758E Cannot connect to WSDM resource >+MuseRuntime.CANT_CONN.ERROR.=IWAT0758E Cannot connect to WSDM resource because resource does not support Metadata Exchange or resource initialization failed. Please see stack trace for exception thrown by resource. >+MuseRuntime.BAD_WSDL.ERROR.=IWAT0882E Cannot connect to WSDM resource because resource returned empty or bad WSDL during Metadata Exchange. > MuseRuntime.CANT_CREATE_DISP_NAME.ERROR.=IWAT0759E Cannot create display name > MuseRuntime.CANT_INVOKE.ERROR.=IWAT0760E Cannot invoke WSDM operation > ServiceGroupHelper.NOT_SG_RESOURCE.INFO.=IWAT0761I This resource is not a service group >Index: src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/MetadataHelper.java >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.tptp.monitoring.managedagent.wsdm.muse/src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/MetadataHelper.java,v >retrieving revision 1.5 >diff -u -r1.5 MetadataHelper.java >--- src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/MetadataHelper.java 21 Mar 2007 21:30:17 -0000 1.5 >+++ src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/MetadataHelper.java 27 Apr 2007 00:35:44 -0000 >@@ -19,6 +19,7 @@ > import javax.xml.namespace.QName; > > import org.apache.muse.tools.inspector.ResourceInspector; >+import org.apache.muse.ws.addressing.EndpointReference; > import org.apache.muse.ws.metadata.remote.MetadataExchangeClient; > import org.apache.muse.ws.resource.remote.WsResourceClient; > import org.eclipse.tptp.monitoring.managedagent.provisional.ManagedResourceAgent; >@@ -31,20 +32,41 @@ > Hashtable _opRetNameMap = new Hashtable(); > Hashtable _metaData = new Hashtable(); > >+ Hashtable _wsdls = new Hashtable(); // save WSDLs keyed by EPR to avoid having to get WSDL if it was already retrieved as part of connect/ping >+ > public Hashtable getMetaData(){ > return _metaData; > } > >+ public void putWSDL(EndpointReference epr, Element wsdl){ >+ _wsdls.put(epr, wsdl); >+ } >+ > public boolean doMetaDataExchange(WsResourceClient _resource) throws Exception { >- ResourceInspector inspector = new ResourceInspector(); > if(_resource==null){ > return false; > } >- MetadataExchangeClient mdxClient = new MetadataExchangeClient(_resource.getDestination()); >- //mdxClient.setTrace(true); >- Element wsdl = mdxClient.getWSDL(); > >- inspector.run(wsdl); >+ Element wsdl = null; >+ try{ >+ wsdl = (Element) _wsdls.get(_resource.getEndpointReference()); >+ }catch(Exception e){ >+ >+ } >+ >+ if(wsdl==null){ >+ MetadataExchangeClient mdxClient = new MetadataExchangeClient(_resource.getDestination()); >+ //mdxClient.setTrace(true); >+ wsdl = mdxClient.getWSDL(); >+ } >+ >+ ResourceInspector inspector = new ResourceInspector(); >+ >+ try{ >+ inspector.run(wsdl); >+ }catch(Exception e){ >+ throw new Exception("Resource inspector threw the following exception when parsing the WSDL from the resource", e); >+ } > > loadPropertiesMetaData(inspector, _metaData); > loadOperationsMetaData(inspector, _metaData); >Index: src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/MuseRuntime.java >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.tptp.monitoring.managedagent.wsdm.muse/src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/MuseRuntime.java,v >retrieving revision 1.5 >diff -u -r1.5 MuseRuntime.java >--- src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/MuseRuntime.java 22 Mar 2007 06:11:00 -0000 1.5 >+++ src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/MuseRuntime.java 27 Apr 2007 00:35:44 -0000 >@@ -22,6 +22,7 @@ > import org.apache.muse.ws.metadata.remote.MetadataExchangeClient; > import org.apache.muse.ws.notification.WsnConstants; > import org.apache.muse.ws.resource.remote.WsResourceClient; >+import org.apache.muse.ws.resource.sg.WssgConstants; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.tptp.monitoring.managedagent.wsdm.agents.provisional.runtime.WSDMRuntime; > import org.w3c.dom.Document; >@@ -48,17 +49,45 @@ > } > > public boolean connect(String epr) throws Exception { >+ boolean emptyWSDL = false; > try{ > Document doc = XmlUtils.createDocument(epr); > Element eprEl = XmlUtils.getFirstElement(doc); > _epr = new EndpointReference(eprEl); > _resource = new WsResourceClient(_epr); > >- // try to get the resource properties document to check the connection >- _resource.getResourcePropertyDocument(); >+ // 167535: all WS-resource may not have resource property documents so we cannot >+ // rely on getResourcePropertyDocument as a ping mechanism >+ // _resource.getResourcePropertyDocument(); >+ >+ // first check to see if resource is SG, since SGs may not support MEX (double check) >+ try{ >+ _resource.getResourceProperty(WssgConstants.ENTRY_QNAME); >+ return true; >+ }catch(Exception exc){ >+ System.out.println("Resource is not a service group"); >+ } >+ >+ // however MAX is guaranteed to work only with resources that support MEX >+ // hence we will try to get the WSDL using MEX and use that as the ping >+ MetadataExchangeClient mdxClient = new MetadataExchangeClient(_resource.getDestination()); >+ //mdxClient.setTrace(true); >+ Element wsdl = mdxClient.getWSDL(); >+ if(wsdl==null){ >+ emptyWSDL=true; >+ throw new Exception(); >+ }else{ >+ // reuse the WSDL that was retrieved and avoid having to do a new call for the WSDL >+ _mHelper.putWSDL(_epr, wsdl); >+ } >+ > //_resource.setTrace(true); > }catch(Throwable t){ >- MuseRuntimePlugin.getDefault().log(Messages.getString("MuseRuntime.CANT_CONN.ERROR."), t, IStatus.ERROR); //$NON-NLS-1$ >+ if(emptyWSDL){ >+ MuseRuntimePlugin.getDefault().log(Messages.getString("MuseRuntime.BAD_WSDL.ERROR."), t, IStatus.ERROR); //$NON-NLS-1$ >+ }else{ >+ MuseRuntimePlugin.getDefault().log(Messages.getString("MuseRuntime.CANT_CONN.ERROR."), t, IStatus.ERROR); //$NON-NLS-1$ >+ } > return false; > } > return true; >@@ -157,10 +186,10 @@ > if(_resource==null) return null; > // providesCapability works only for WSDM resources, but this has to be a wsdm resource to > // have relationships (MUWS Part 2) >- if(!CommonUtils.providesCapability(_resource, MuwsConstants.RELATIONSHIP_RESOURCE_URI)){ >+ /* if(!CommonUtils.providesCapability(_resource, MuwsConstants.RELATIONSHIP_RESOURCE_URI)){ > System.out.println("This is not a relationships resource"); //$NON-NLS-1$ > //throw new Exception("Not a relationship resource"); >- } >+ }*/ > return _rHelper.getRelationships(_resource); > } > >@@ -168,10 +197,6 @@ > if(_resource==null) return null; > > Element[] els = _resource.getResourceProperty(WsnConstants.TOPIC_EXPRESSION_QNAME); >- if( els == null || els.length <= 0 ){ >- System.out.println("No topics defined"); >- } >- > return _tHelper.getTopics(_resource); > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 167535
:
65130
|
65131
| 65132