1 22 package org.jboss.test.system.controller.configure.binding.support; 23 24 import javax.management.Attribute ; 25 import javax.management.MBeanServer ; 26 import javax.management.ObjectName ; 27 28 import org.jboss.system.ServiceBinding; 29 30 36 public class TestServiceBinding implements ServiceBinding 37 { 38 private MBeanServer server; 39 private boolean error; 40 private ObjectName invoked; 41 42 public TestServiceBinding(MBeanServer server, boolean error) 43 { 44 this.server = server; 45 this.error = error; 46 } 47 48 public ObjectName getInvoked() 49 { 50 return invoked; 51 } 52 53 public void applyServiceConfig(ObjectName serviceName) throws Exception 54 { 55 this.invoked = serviceName; 56 57 if (error) 58 throw new RuntimeException ("Throwing error as required by test"); 59 60 Attribute attribute = new Attribute ("Attribute2", "frombinding"); 61 server.setAttribute(serviceName, attribute); 62 } 63 } 64 | Popular Tags |