Method from org.apache.geronimo.connector.outbound.ManagedConnectionFactoryWrapper Detail: |
public Object $getConnectionFactory() throws ResourceException {
Object connectionFactory = connectionManagerContainer.createConnectionFactory(managedConnectionFactory);
for (Class intf: allImplementedInterfaces) {
if (!intf.isAssignableFrom(connectionFactory.getClass())) {
throw new ResourceException("ConnectionFactory does not implement expected interface: " + intf.getName());
}
}
return connectionFactory;
}
|
public ManagedConnectionFactory $getManagedConnectionFactory() {
return managedConnectionFactory;
}
|
public Object $getResource() throws ResourceException {
return $getConnectionFactory();
}
|
public void doFail() {
doStop();
}
|
public void doStart() throws Exception {
//register with resource adapter
if (managedConnectionFactory instanceof ResourceAdapterAssociation) {
if (resourceAdapterWrapper == null) {
throw new IllegalStateException("Managed connection factory expects to be registered with a ResourceAdapter, but there is no ResourceAdapter");
}
resourceAdapterWrapper.registerResourceAdapterAssociation((ResourceAdapterAssociation) managedConnectionFactory);
log.debug("Registered managedConnectionFactory with ResourceAdapter " + resourceAdapterWrapper.toString());
}
connectionManagerContainer.doRecovery(managedConnectionFactory);
}
|
public void doStop() {
}
|
public Object getAttribute(String name) throws Exception {
Thread thread = Thread.currentThread();
ClassLoader oldTCL = thread.getContextClassLoader();
thread.setContextClassLoader(classLoader);
try {
return delegate.getAttribute(name);
} finally {
thread.setContextClassLoader(oldTCL);
}
}
|
public Map<String, Class> getConfigProperties() {
String[] props = delegate.getProperties();
Map< String, Class > map = new HashMap< String, Class >();
for (String prop : props) {
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 Class). |
public Object getConfigProperty(String property) throws Exception {
return delegate.getAttribute(property);
}
|
public Object getConnectionFactory() throws ResourceException {
return $getConnectionFactory();
}
|
public String getConnectionFactoryImplClass() {
return connectionFactoryImplClass;
}
|
public String getConnectionFactoryInterface() {
return connectionFactoryInterface;
}
|
public String getConnectionImplClass() {
return connectionImplClass;
}
|
public String getConnectionInterface() {
return connectionInterface;
}
|
public Object getConnectionManagerContainer() {
return connectionManagerContainer;
}
|
public String[] getImplementedInterfaces() {
return implementedInterfaces;
}
|
public String getManagedConnectionFactoryClass() {
return managedConnectionFactoryClass;
}
|
public String getObjectName() {
return objectName;
}
|
public ResourceAdapterWrapper getResourceAdapterWrapper() {
return resourceAdapterWrapper;
}
|
public Object invoke(String name,
Object[] arguments,
String[] types) throws Exception {
//we have no dynamic operations.
return null;
}
|
public boolean isEventProvider() {
return false;
}
|
public boolean isStateManageable() {
return false;
}
|
public boolean isStatisticsProvider() {
return false;
}
|
public void setAttribute(String name,
Object value) throws Exception {
Thread thread = Thread.currentThread();
ClassLoader oldTCL = thread.getContextClassLoader();
thread.setContextClassLoader(classLoader);
try {
delegate.setAttribute(name, value);
} finally {
thread.setContextClassLoader(oldTCL);
}
}
|
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);
}
|