Wrapper around AdminObject that exposes its config-properties as GBeanAttributes and
supplies a disconnectable proxy to bind in jndi.
Method from org.apache.geronimo.connector.AdminObjectWrapper Detail: |
public Object $getResource() {
return adminObject;
}
Returns disconnectable proxy for binding in jndi. |
public void doFail() {
}
Fails the GBean. This informs the GBean that it is about to transition to the failed state. |
public void doStart() throws Exception {
if (adminObject instanceof ResourceAdapterAssociation) {
if (resourceAdapterWrapper == null) {
throw new IllegalStateException("Admin object expects to be registered with a ResourceAdapter, but there is no ResourceAdapter");
}
resourceAdapterWrapper.registerResourceAdapterAssociation((ResourceAdapterAssociation) adminObject);
}
}
Starts the GBean. This informs the GBean that it is about to transition to the running state. |
public void doStop() throws Exception {
}
Stops the target. This informs the GBean that it is about to transition to the stopped state. |
public String getAdminObjectClass() {
return adminObjectClass;
}
Returns class of wrapped AdminObject. |
public String getAdminObjectInterface() {
return adminObjectInterface;
}
|
public Object getAttribute(String name) throws Exception {
return delegate.getAttribute(name);
}
Delegating DynamicGBean getAttribute method. |
public Map getConfigProperties() {
String[] props = delegate.getProperties();
Map map = new HashMap();
for (int i = 0; i < props.length; i++) {
String prop = props[i];
if(prop.equals("logWriter")) {
continue;
}
map.put(prop, delegate.getPropertyType(prop));
}
return map;
}
Gets the config properties in the form of a map where the key is the
property name and the value is property type (as a String not a Class). |
public Object getConfigProperty(String property) throws Exception {
return delegate.getAttribute(property);
}
|
public String getObjectName() {
return objectName;
}
|
public Object invoke(String name,
Object[] arguments,
String[] types) throws Exception {
//we have no dynamic operations.
return null;
}
no-op DynamicGBean method |
public boolean isEventProvider() {
return false;
}
|
public boolean isStateManageable() {
return false;
}
|
public boolean isStatisticsProvider() {
return false;
}
|
public void setAttribute(String name,
Object value) throws Exception {
delegate.setAttribute(name, value);
}
Delegating DynamicGBean setAttribute method. |
public void setConfigProperty(String property,
Object value) throws Exception {
Class cls = delegate.getPropertyType(property);
if(value != null && value instanceof String && !cls.getName().equals("java.lang.String")) {
if(cls.isPrimitive()) {
if(cls.equals(int.class)) {
cls = Integer.class;
} else if(cls.equals(boolean.class)) {
cls = Boolean.class;
} else if(cls.equals(float.class)) {
cls = Float.class;
} else if(cls.equals(double.class)) {
cls = Double.class;
} else if(cls.equals(long.class)) {
cls = Long.class;
} else if(cls.equals(short.class)) {
cls = Short.class;
} else if(cls.equals(byte.class)) {
cls = Byte.class;
} else if(cls.equals(char.class)) {
cls = Character.class;
}
}
Constructor con = cls.getConstructor(new Class[]{String.class});
value = con.newInstance(new Object[]{value});
}
kernel.setAttribute(abstractName, property, value);
}
|