Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 167280 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/tptp/monitoring/managedagent/provisional/helper/ManagedAgentCommandHelper.java (-11 / +13 lines)
Lines 183-188 Link Here
183
	}*/
183
	}*/
184
	
184
	
185
	public void getMetaData() throws Exception{
185
	public void getMetaData() throws Exception{
186
		try{
187
			_request = new CommandWrapper();
188
			_request.setOperationName(Constants.LOAD_META_DATA_COMMAND);
189
			execute(_request);
190
		}catch(Exception e){
191
			ManagedAgentPlugin.getDefault().log(Messages.getString("ManagedAgentCommandHelper.INVALID_MEX.WARN."), e, IStatus.WARNING); //$NON-NLS-1$
192
			// If this line will done uncommented than Service Group profiling
193
			// will fail, since ResourceInspector says "The resource inspector can 
194
			// only process WSDLs with one service"
195
			//throw e;
196
		}
197
		
186
		boolean isServiceGroup = false;	
198
		boolean isServiceGroup = false;	
187
		Hashtable membersData = null;
199
		Hashtable membersData = null;
188
		try{
200
		try{
Lines 226-242 Link Here
226
		
238
		
227
		getRelationships();
239
		getRelationships();
228
		getTopics();
240
		getTopics();
229
		try{
241
230
			_request = new CommandWrapper();
231
			_request.setOperationName(Constants.LOAD_META_DATA_COMMAND);
232
			execute(_request);
233
		}catch(Exception e){
234
			ManagedAgentPlugin.getDefault().log(Messages.getString("ManagedAgentCommandHelper.INVALID_MEX.WARN."), e, IStatus.WARNING); //$NON-NLS-1$
235
			// If this line will done uncommented than Service Group profiling
236
			// will fail, since ResourceInspector says "The resource inspector can 
237
			// only process WSDLs with one service"
238
			//throw e;
239
		}
240
		
242
		
241
		Hashtable propsMetaData = null;
243
		Hashtable propsMetaData = null;
242
		try{
244
		try{
(-)src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/MetadataHelper.java (-3 / +18 lines)
Lines 42-47 Link Here
42
		_wsdls.put(epr, wsdl);
42
		_wsdls.put(epr, wsdl);
43
	}
43
	}
44
	
44
	
45
	public Element getWSDL(EndpointReference epr) throws Exception{
46
		try{
47
			Element wsdl = (Element) _wsdls.get(epr);
48
			if(wsdl!=null) return wsdl;
49
		}catch(Exception e){
50
		}
51
		return retrieveWSDL(epr);
52
	}
53
	
54
	private Element retrieveWSDL(EndpointReference epr) throws Exception{
55
		MetadataExchangeClient mdxClient = new MetadataExchangeClient(epr);
56
		//mdxClient.setTrace(true);
57
		Element wsdl = mdxClient.getWSDL();
58
		putWSDL(epr, wsdl);
59
		return wsdl;
60
	}
61
	
45
	public boolean doMetaDataExchange(WsResourceClient _resource) throws Exception {
62
	public boolean doMetaDataExchange(WsResourceClient _resource) throws Exception {
46
		if(_resource==null){
63
		if(_resource==null){
47
			return false;
64
			return false;
Lines 55-63 Link Here
55
		}
72
		}
56
		
73
		
57
		if(wsdl==null){
74
		if(wsdl==null){
58
			MetadataExchangeClient mdxClient = new MetadataExchangeClient(_resource.getDestination());
75
			wsdl = retrieveWSDL(_resource.getDestination());
59
			//mdxClient.setTrace(true);
60
			wsdl = mdxClient.getWSDL();
61
		}
76
		}
62
77
63
		ResourceInspector inspector = new ResourceInspector();
78
		ResourceInspector inspector = new ResourceInspector();
(-)src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/MuseRuntime.java (-11 / +6 lines)
Lines 18-25 Link Here
18
import org.apache.muse.tools.inspector.ResourceInspector;
18
import org.apache.muse.tools.inspector.ResourceInspector;
19
import org.apache.muse.util.xml.XmlUtils;
19
import org.apache.muse.util.xml.XmlUtils;
20
import org.apache.muse.ws.addressing.EndpointReference;
20
import org.apache.muse.ws.addressing.EndpointReference;
21
import org.apache.muse.ws.dm.muws.MuwsConstants;
22
import org.apache.muse.ws.metadata.remote.MetadataExchangeClient;
23
import org.apache.muse.ws.notification.WsnConstants;
21
import org.apache.muse.ws.notification.WsnConstants;
24
import org.apache.muse.ws.resource.remote.WsResourceClient;
22
import org.apache.muse.ws.resource.remote.WsResourceClient;
25
import org.apache.muse.ws.resource.sg.WssgConstants;
23
import org.apache.muse.ws.resource.sg.WssgConstants;
Lines 69-77 Link Here
69
			
67
			
70
			// however MAX is guaranteed to work only with resources that support MEX
68
			// however MAX is guaranteed to work only with resources that support MEX
71
			// hence we will try to get the WSDL using MEX and use that as the ping
69
			// hence we will try to get the WSDL using MEX and use that as the ping
72
			MetadataExchangeClient mdxClient = new MetadataExchangeClient(_resource.getDestination());
70
			Element wsdl = _mHelper.getWSDL(_resource.getDestination());
73
			//mdxClient.setTrace(true);
74
			Element wsdl = mdxClient.getWSDL();
75
			if(wsdl==null){
71
			if(wsdl==null){
76
				emptyWSDL=true;
72
				emptyWSDL=true;
77
				throw new Exception();
73
				throw new Exception();
Lines 84-93 Link Here
84
		}catch(Throwable t){
80
		}catch(Throwable t){
85
			if(emptyWSDL){
81
			if(emptyWSDL){
86
				MuseRuntimePlugin.getDefault().log(Messages.getString("MuseRuntime.BAD_WSDL.ERROR."), t, IStatus.ERROR); //$NON-NLS-1$
82
				MuseRuntimePlugin.getDefault().log(Messages.getString("MuseRuntime.BAD_WSDL.ERROR."), t, IStatus.ERROR); //$NON-NLS-1$
83
				throw new Exception(Messages.getString("MuseRuntime.BAD_WSDL.ERROR."), t);//$NON-NLS-1$
87
			}else{
84
			}else{
88
				MuseRuntimePlugin.getDefault().log(Messages.getString("MuseRuntime.CANT_CONN.ERROR."), t, IStatus.ERROR); //$NON-NLS-1$
85
				MuseRuntimePlugin.getDefault().log(Messages.getString("MuseRuntime.CANT_CONN.ERROR."), t, IStatus.ERROR); //$NON-NLS-1$
86
				throw new Exception(Messages.getString("MuseRuntime.CANT_CONN.ERROR."), t);//$NON-NLS-1$
89
			}
87
			}
90
			return false;
91
		}
88
		}
92
		return true;
89
		return true;
93
	}
90
	}
Lines 125-138 Link Here
125
		Element wsdl;
122
		Element wsdl;
126
		Object result = null;
123
		Object result = null;
127
		try {			
124
		try {			
128
			MetadataExchangeClient mdxClient = new MetadataExchangeClient(_resource.getDestination());
125
			wsdl = _mHelper.getWSDL(_resource.getDestination());
129
			wsdl = mdxClient.getWSDL();
130
			inspector.run(wsdl);
126
			inspector.run(wsdl);
131
			
132
			result = inspector.invoke(_resource, operationQName, params);
127
			result = inspector.invoke(_resource, operationQName, params);
133
		} catch (Exception e) {
128
		} catch (Exception e) {
134
			MuseRuntimePlugin.getDefault().log(Messages.getString("MuseRuntime.CANT_INVOKE.ERROR."), e, IStatus.ERROR); //$NON-NLS-1$
129
			MuseRuntimePlugin.getDefault().log(Messages.getString("MuseRuntime.CANT_INVOKE.ERROR."), e, IStatus.ERROR); //$NON-NLS-1$
135
			throw e;
130
			throw new Exception(Messages.getString("MuseRuntime.CANT_INVOKE.ERROR."), e);
136
		}
131
		}
137
		return result;
132
		return result;
138
	}
133
	}
Lines 195-201 Link Here
195
	public ArrayList getTopics() throws Exception{
190
	public ArrayList getTopics() throws Exception{
196
		if(_resource==null) return null;
191
		if(_resource==null) return null;
197
		
192
		
198
		Element[] els = _resource.getResourceProperty(WsnConstants.TOPIC_EXPRESSION_QNAME);
193
		_resource.getResourceProperty(WsnConstants.TOPIC_EXPRESSION_QNAME);
199
		return _tHelper.getTopics(_resource);
194
		return _tHelper.getTopics(_resource);
200
	}
195
	}
201
}
196
}

Return to bug 167280