use of org.glassfish.hk2.external.org.objectweb.asm.commons.Method in project Payara by payara.
the class ActiveJmsResourceAdapter method setMasterBroker.
public void setMasterBroker(String newMasterBroker) {
try {
Class c = resourceadapter_.getClass();
Method m = c.getMethod("setMasterBroker", String.class);
m.invoke(resourceadapter_, newMasterBroker);
if (_logger.isLoggable(Level.INFO)) {
_logger.log(Level.INFO, JMSLoggerInfo.MASTER_BROKER_SUCCESS, new Object[] { newMasterBroker });
}
} catch (Exception ex) {
// throw new RuntimeException ("Error invoking PortMapperClientHandler.handleRequest. Cause - " + ex.getMessage(), ex);
if (_logger.isLoggable(Level.INFO)) {
_logger.log(Level.INFO, JMSLoggerInfo.MASTER_BROKER_FAILURE, new Object[] { newMasterBroker, ex.getMessage() });
}
}
}
use of org.glassfish.hk2.external.org.objectweb.asm.commons.Method in project Payara by payara.
the class ActiveJmsResourceAdapter method postRAConfiguration.
/*
* Gets all the other [apart from serverlist] DataSource properties from
* the HADB JDBC connection pool.
*
private Properties getDSPropertiesFromThePool(JdbcConnectionPool jdbcConPool) {
Properties p = new Properties();
List elemProp = jdbcConPool.getProperty();
Set<String> excludeList = new HashSet<String>();
excludeList.add(DUSERNAME);
excludeList.add(DPASSWORD);
excludeList.add(DSERVERLIST);
for(Property e: elemProp) {
String propName = e.getAttributeValue("name");
if (!excludeList.contains(propName)) {
p.setProperty(propName, e.getAttributeValue("value"));
}
}
logFine("Additional DataSource properties from pool "
+ jdbcConPool.getName() + " are " + p);
return p;
}*/
/**
* Method to perform any post RA configuration action by derivative subclasses.
* For example, this method is used by <code>ActiveJMSResourceAdapter</code>
* to set unsupported javabean property types on its RA JavaBean runtime
* instance.
* @throws ConnectorRuntimeException
*/
protected void postRAConfiguration() throws ConnectorRuntimeException {
// Set all non-supported javabean property types in the JavaBean
try {
if (dbProps == null)
dbProps = new Properties();
dbProps.setProperty("imq.cluster.dynamicChangeMasterBrokerEnabled", "true");
Method mthds = this.resourceadapter_.getClass().getMethod("setBrokerProps", Properties.class);
if (_logger.isLoggable(Level.FINE))
logFine("Setting property:" + DB_HADB_PROPS + "=" + dbProps.toString());
mthds.invoke(this.resourceadapter_, new Object[] { dbProps });
} catch (Exception e) {
ConnectorRuntimeException crex = new ConnectorRuntimeException(e.getMessage());
throw (ConnectorRuntimeException) crex.initCause(e);
}
}
use of org.glassfish.hk2.external.org.objectweb.asm.commons.Method in project Payara by payara.
the class PluginHandlers method getPluginService.
/**
* <p> Find and return the <code>ConsolePluginService</code>. This method
* uses the HK2 <code>Habitat</code> to locate the
* <code>ConsolePluginService</code>.</p>
*
* @param ctx The <code>FacesContext</code>.
*
* @returns The <code>ConsolePluginService</code>.
*/
public static ConsolePluginService getPluginService(FacesContext ctx) {
// We need to get the ServletContext to find the Habitat
ServletContext servletCtx = (ServletContext) (ctx.getExternalContext()).getContext();
// Get the Habitat from the ServletContext
ServiceLocator habitat = (ServiceLocator) servletCtx.getAttribute(org.glassfish.admingui.common.plugin.ConsoleClassLoader.HABITAT_ATTRIBUTE);
return habitat.getService(ConsolePluginService.class);
}
use of org.glassfish.hk2.external.org.objectweb.asm.commons.Method in project Payara by payara.
the class EjbOptionalIntfGenerator method generateInterfaceMethod.
private static void generateInterfaceMethod(ClassVisitor cv, java.lang.reflect.Method m) throws Exception {
String methodName = m.getName();
Type returnType = Type.getReturnType(m);
Type[] argTypes = Type.getArgumentTypes(m);
Method asmMethod = new Method(methodName, returnType, argTypes);
GeneratorAdapter cg = new GeneratorAdapter(ACC_PUBLIC + ACC_ABSTRACT, asmMethod, null, getExceptionTypes(m), cv);
cg.endMethod();
}
use of org.glassfish.hk2.external.org.objectweb.asm.commons.Method in project Payara by payara.
the class EjbOptionalIntfGenerator method generateSetDelegateMethod.
private static void generateSetDelegateMethod(ClassVisitor cv, Class delegateClass, String subClassName) throws Exception {
Class optProxyClass = OptionalLocalInterfaceProvider.class;
java.lang.reflect.Method proxyMethod = optProxyClass.getMethod("setOptionalLocalIntfProxy", java.lang.reflect.Proxy.class);
String methodName = proxyMethod.getName();
Type returnType = Type.getReturnType(proxyMethod);
Type[] argTypes = Type.getArgumentTypes(proxyMethod);
Type[] eTypes = getExceptionTypes(proxyMethod);
Method asmMethod = new Method(methodName, returnType, argTypes);
GeneratorAdapter mg2 = new GeneratorAdapter(ACC_PUBLIC, asmMethod, null, eTypes, cv);
mg2.visitVarInsn(ALOAD, 0);
mg2.visitVarInsn(ALOAD, 1);
mg2.visitTypeInsn(CHECKCAST, delegateClass.getName().replace('.', '/'));
String delIntClassDesc = Type.getType(delegateClass).getDescriptor();
mg2.visitFieldInsn(PUTFIELD, subClassName.replace('.', '/'), DELEGATE_FIELD_NAME, delIntClassDesc);
mg2.returnValue();
mg2.endMethod();
}
Aggregations