Search Results

Search found 2 results on 1 pages for 'thor84no'.

Page 1/1 | 1 

  • Can JMX operations take interfaces as parameters?

    - by Thor84no
    I'm having problems with an MBean that takes a Map<String, Object> as a parameter. If I try to execute it via JMX using a proxy object, I get an Exception: Caused by: javax.management.ReflectionException at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:231) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) Caused by: java.lang.IllegalArgumentException: Unable to find operation updateProperties(java.util.HashMap) It appears that it attempts to use the actual implementation class rather than the interface, and doesn't check if this is a child of the required interface. The same thing happens for extended classes (for example declare HashMap, pass in LinkedHashMap). Does this mean it's impossible to use an interface for such methods? At the moment I'm getting around it by changing the method signature to accept a HashMap, but it seems odd that I wouldn't be able to use interfaces (or extended classes) in my MBeans. Edit: The proxy object is being created by an in-house utility class called JmxInvocationHandler. The (hopefully) relevant parts of it are as follows: public class JmxInvocationHandler implements InvocationHandler { ... public static <T> T createMBean(final Class<T> iface, SFSTestProperties properties, String mbean, int shHostID) { T newProxyInstance = (T) Proxy.newProxyInstance(iface.getClassLoader(), new Class[] { iface }, (InvocationHandler) new JmxInvocationHandler(properties, mbean, shHostID)); return newProxyInstance; } ... private JmxInvocationHandler(SFSTestProperties properties, String mbean, int shHostID) { this.mbeanName = mbean + MBEAN_SUFFIX + shHostID; msConfig = new MsConfiguration(properties.getHost(0), properties.getMSAdminPort(), properties.getMSUser(), properties.getMSPassword()); } ... public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (management == null) { management = ManagementClientStore.getInstance().getManagementClient(msConfig.getHost(), msConfig.getAdminPort(), msConfig.getUser(), msConfig.getPassword(), false); } final Object result = management.methodCall(mbeanName, method.getName(), args == null? new Object[] {} : args); return result; } }

    Read the article

  • Is there any library/software available that can give me useful measurements of image quality?

    - by Thor84no
    I realise measuring image quality in software is going to be really difficult, and I'm not looking for a quick-fix. Googling this is largely showing up research papers and discussions that go a bit over my head, so I was wondering if anyone in the SO community had any experience with doing any rough image quality assessment? I want to use this to scan a few thousand images and whittle it down to a few dozen images that are most likely of poor quality. I could then show these to a user and leave the rest to them. Obviously there are many metrics that can be a part of whether an image is of high/low quality, I'd be happy with anything that could take an image as an input and give some reasonable metrics to any of the basic image quality metrics like sharpness, dynamic range, noise, etc., leaving it up to my software to determine what's acceptable and what isn't. Some of the images are poor quality because they've been up-scaled drastically. If there isn't a way of getting metrics like I suggested above, is there any way to detect that an image has been up-scaled like this?

    Read the article

1