return config;
}
public OperationResult invokeOperation(String s, Configuration configuration) throws InterruptedException, Exception
{
Operation oper = Operation.getOperation(s);
Collection<PropertySimple> props = configuration.getSimpleProperties().values();
SimpleValueSupport[] params = new SimpleValueSupport[props.size()];
SimpleValueSupport[] signature = new SimpleValueSupport[props.size()];
populateParams(props, params, signature);
ArrayValueSupport param = new ArrayValueSupport(new ArrayMetaType(SimpleMetaType.STRING, false));
param.setValue(params);
ArrayValueSupport sig = new ArrayValueSupport(new ArrayMetaType(SimpleMetaType.STRING, false));
sig.setValue(signature);
SimpleValueSupport queueName = new SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey());
SimpleValueSupport methodName = new SimpleValueSupport(SimpleMetaType.STRING, oper.getOperationName());
ManagementView view = getProfileService();
String methodOperation = getInvokeOperation();
if("JMSMessage".equalsIgnoreCase(oper.getResultsType()))
{
methodOperation = getInvokeOperationJMSMessage();
}
else if("SubscriptionInfo".equalsIgnoreCase(oper.getResultsType()))
{
methodOperation = getInvokeOperationSubscriptionMessage();
}
ManagedOperation operation = ManagementSupport.getOperation(view, getComponentName(), methodOperation, getComponentType());
Object result = null;
result = operation.invoke(queueName, methodName, param, sig);
if (result == null)
{
return null;
}
return formatResults(result, oper.getResultsType());
}