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 185625 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/tptp/monitoring/managedagent/provisional/ManagedResourceAgent.java (-1 / +44 lines)
Lines 17-23 Link Here
17
import java.util.ArrayList;
17
import java.util.ArrayList;
18
import java.util.Hashtable;
18
import java.util.Hashtable;
19
19
20
import org.eclipse.core.filesystem.EFS;
21
import org.eclipse.core.filesystem.IFileStore;
22
import org.eclipse.core.runtime.IPath;
20
import org.eclipse.core.runtime.IStatus;
23
import org.eclipse.core.runtime.IStatus;
24
import org.eclipse.core.runtime.Platform;
21
import org.eclipse.hyades.internal.execution.local.common.CustomCommand;
25
import org.eclipse.hyades.internal.execution.local.common.CustomCommand;
22
import org.eclipse.hyades.internal.execution.local.common.DataProcessor;
26
import org.eclipse.hyades.internal.execution.local.common.DataProcessor;
23
import org.eclipse.hyades.internal.execution.local.control.Agent;
27
import org.eclipse.hyades.internal.execution.local.control.Agent;
Lines 26-35 Link Here
26
import org.eclipse.hyades.internal.execution.local.control.InactiveAgentException;
30
import org.eclipse.hyades.internal.execution.local.control.InactiveAgentException;
27
import org.eclipse.hyades.internal.execution.local.control.InactiveProcessException;
31
import org.eclipse.hyades.internal.execution.local.control.InactiveProcessException;
28
import org.eclipse.hyades.internal.execution.local.control.Process;
32
import org.eclipse.hyades.internal.execution.local.control.Process;
33
import org.eclipse.swt.widgets.Display;
29
import org.eclipse.tptp.monitoring.managedagent.ManagedAgentPlugin;
34
import org.eclipse.tptp.monitoring.managedagent.ManagedAgentPlugin;
30
import org.eclipse.tptp.monitoring.managedagent.internal.Constants;
35
import org.eclipse.tptp.monitoring.managedagent.internal.Constants;
31
import org.eclipse.tptp.monitoring.managedagent.provisional.commands.CommandSerializer;
36
import org.eclipse.tptp.monitoring.managedagent.provisional.commands.CommandSerializer;
32
import org.eclipse.tptp.monitoring.managedagent.provisional.commands.CommandWrapper;
37
import org.eclipse.tptp.monitoring.managedagent.provisional.commands.CommandWrapper;
38
import org.eclipse.ui.IWorkbenchPage;
39
import org.eclipse.ui.IWorkbenchWindow;
40
import org.eclipse.ui.PartInitException;
41
import org.eclipse.ui.PlatformUI;
42
import org.eclipse.ui.ide.IDE;
33
43
34
/**
44
/**
35
 * An abstract class that implements the TPTP Agent interface and allows follows the custom command API defined for managed agents.
45
 * An abstract class that implements the TPTP Agent interface and allows follows the custom command API defined for managed agents.
Lines 445-454 Link Here
445
				sendResponse(_command);
455
				sendResponse(_command);
446
			}catch(Exception ex){
456
			}catch(Exception ex){
447
				throwException(ex);
457
				throwException(ex);
458
				openErrorLog(ex);
448
			}
459
			}
449
		}catch(Exception e){
460
		}catch(Exception e){
450
			ManagedAgentPlugin.getDefault().log(Messages.getString("ManagedResourceAgent.CANT_SERICE_CUSTOM_COMMAND.ERROR."), e, IStatus.ERROR); //$NON-NLS-1$
461
			ManagedAgentPlugin.getDefault().log(Messages.getString("ManagedResourceAgent.CANT_SERICE_CUSTOM_COMMAND.ERROR."), e, IStatus.ERROR); //$NON-NLS-1$	
451
			setActive(false);
462
			setActive(false);
452
		}
463
		}
453
	}
464
	}
465
	
466
	private void openErrorLog(Exception ex)
467
	{
468
		// Ignore the warning message "IWAT0753I Found and instantiated Apache Muse Runtime WSDM runtime"
469
		boolean museFoundMessage = ex.getMessage().indexOf("IWAT0753I")!=-1;		
470
		// Ignore the warning message "IWAT0761I This resource is not a service group"
471
		boolean sgMessage = ex.getMessage().indexOf("IWAT0761I")!=-1 || ex.getMessage().indexOf("IWAT0762E")!=-1;
472
		if(museFoundMessage || sgMessage)
473
			return;
474
		
475
		IPath logPath = Platform.getLogFileLocation();
476
        final IFileStore fileStore = EFS.getLocalFileSystem().getStore(logPath);
477
        if(!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists())
478
        {
479
            Display display = PlatformUI.getWorkbench().getDisplay();
480
            display.asyncExec(new Runnable(){
481
482
				public void run() {
483
					IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
484
		            IWorkbenchPage page = window.getActivePage();
485
		            try
486
		            {
487
		                IDE.openEditorOnFileStore(page, fileStore);
488
		            }
489
		            catch(PartInitException _ex) 
490
		            { 
491
		            	_ex.printStackTrace();
492
		            }					
493
				}});
494
        }
495
    }
496
454
}
497
}
(-)META-INF/MANIFEST.MF (-1 / +3 lines)
Lines 13-19 Link Here
13
Require-Bundle: org.eclipse.tptp.platform.models;visibility:=reexport,
13
Require-Bundle: org.eclipse.tptp.platform.models;visibility:=reexport,
14
 org.eclipse.hyades.execution;visibility:=reexport,
14
 org.eclipse.hyades.execution;visibility:=reexport,
15
 org.eclipse.hyades.trace.ui;visibility:=reexport,
15
 org.eclipse.hyades.trace.ui;visibility:=reexport,
16
 org.eclipse.ui;visibility:=reexport
16
 org.eclipse.ui;visibility:=reexport,
17
 org.eclipse.core.filesystem,
18
 org.eclipse.ui.ide
17
Eclipse-LazyStart: true
19
Eclipse-LazyStart: true
18
Bundle-Vendor: %plugin.provider
20
Bundle-Vendor: %plugin.provider
19
Bundle-Activator: org.eclipse.tptp.monitoring.managedagent.ManagedAgentPlugin
21
Bundle-Activator: org.eclipse.tptp.monitoring.managedagent.ManagedAgentPlugin
(-)src/org/eclipse/tptp/monitoring/managedagent/wsdm/provisional/agents/WSDMAgent.java (-1 / +2 lines)
Lines 116-122 Link Here
116
		}catch(Exception e){
116
		}catch(Exception e){
117
			Activator.getDefault().log(Messages.getString("WSDMAgent.CANT_INIT_AGENT.ERROR."), e, IStatus.ERROR); //$NON-NLS-1$
117
			Activator.getDefault().log(Messages.getString("WSDMAgent.CANT_INIT_AGENT.ERROR."), e, IStatus.ERROR); //$NON-NLS-1$
118
			setActive(false);
118
			setActive(false);
119
			return false;
119
			throw e;
120
			//return false;
120
		}
121
		}
121
	}
122
	}
122
	
123
	
(-)src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/MuseRuntime.java (-3 / +10 lines)
Lines 15-26 Link Here
15
import java.util.ArrayList;
15
import java.util.ArrayList;
16
import java.util.Hashtable;
16
import java.util.Hashtable;
17
17
18
import javax.xml.namespace.QName;
19
18
import org.apache.muse.tools.inspector.ResourceInspector;
20
import org.apache.muse.tools.inspector.ResourceInspector;
19
import org.apache.muse.util.xml.XmlUtils;
21
import org.apache.muse.util.xml.XmlUtils;
20
import org.apache.muse.ws.addressing.EndpointReference;
22
import org.apache.muse.ws.addressing.EndpointReference;
21
import org.apache.muse.ws.dm.muws.MuwsConstants;
23
import org.apache.muse.ws.dm.muws.MuwsConstants;
22
import org.apache.muse.ws.metadata.remote.MetadataExchangeClient;
24
import org.apache.muse.ws.metadata.remote.MetadataExchangeClient;
23
import org.apache.muse.ws.notification.WsnConstants;
25
import org.apache.muse.ws.notification.WsnConstants;
26
import org.apache.muse.ws.resource.properties.WsrpConstants;
24
import org.apache.muse.ws.resource.remote.WsResourceClient;
27
import org.apache.muse.ws.resource.remote.WsResourceClient;
25
import org.apache.muse.ws.resource.sg.WssgConstants;
28
import org.apache.muse.ws.resource.sg.WssgConstants;
26
import org.eclipse.core.runtime.IStatus;
29
import org.eclipse.core.runtime.IStatus;
Lines 87-93 Link Here
87
			}else{
90
			}else{
88
				MuseRuntimePlugin.getDefault().log(Messages.getString("MuseRuntime.CANT_CONN.ERROR."), t, IStatus.ERROR); //$NON-NLS-1$
91
				MuseRuntimePlugin.getDefault().log(Messages.getString("MuseRuntime.CANT_CONN.ERROR."), t, IStatus.ERROR); //$NON-NLS-1$
89
			}
92
			}
90
			return false;
93
			throw new Exception(t);
94
			//return false;
91
		}
95
		}
92
		return true;
96
		return true;
93
	}
97
	}
Lines 137-145 Link Here
137
		return result;
141
		return result;
138
	}
142
	}
139
143
140
	public Object[] getResourceProperty(String propQName) throws Exception {
144
	public Object[] getResourceProperty(String qnameStr) throws Exception {
141
		// smashing of values into one string happens in UI controller
145
		// smashing of values into one string happens in UI controller
142
		Element[] results = _resource.getResourceProperty(CommonUtils.deserializeFromString(propQName));
146
		QName propQName = CommonUtils.deserializeFromString(qnameStr);
147
		if(propQName.getNamespaceURI().equals(WsrpConstants.NAMESPACE_URI))
148
			propQName = new QName(propQName.getNamespaceURI(), propQName.getLocalPart(), WsrpConstants.PREFIX);
149
		Element[] results = _resource.getResourceProperty(propQName);
143
		String[] ret = new String[results.length];
150
		String[] ret = new String[results.length];
144
		for (int i = 0; i < results.length; i++) {
151
		for (int i = 0; i < results.length; i++) {
145
			ret[i] = XmlUtils.extractText(results[i]);
152
			ret[i] = XmlUtils.extractText(results[i]);

Return to bug 185625