private static void init() { if (!initialized) { initialized = true; Log.info("Usemon agent initialized"); } // Bootstrap the publisher Registry.ensurePublisherAvailable(); }
private static byte[] findTypeAndTransform(CtClass javaClass) throws CannotCompileException, IOException, NotFoundException { int componentType = findComponentType(javaClass); ClassFile cf = javaClass.getClassFile(); if (componentType != Info.COMPONENT_UNKNOWN && !cf.isInterface() && !cf.isAbstract()) { Log.info( javaClass.getName() + " is of type " + Info.TYPES[componentType] + " and will be instrumented"); switch (componentType) { case Info.COMPONENT_SESSIONBEAN: return ComponentTransformer.transformSessionBean(javaClass); case Info.COMPONENT_ENTITYBEAN: return ComponentTransformer.transformEntityBean(javaClass); case Info.COMPONENT_MESSAGEDRIVENBEAN: return ComponentTransformer.transformMessageDrivenBean(javaClass); case Info.COMPONENT_CUSTOM: return ComponentTransformer.transformCustom(javaClass); case Info.COMPONENT_QUEUESENDER: return ComponentTransformer.transformQueueSender(javaClass); case Info.COMPONENT_SERVLET: return ComponentTransformer.transformServlet(javaClass); case Info.COMPONENT_SINGLETON: return ComponentTransformer.transformSingleton(javaClass); case Info.COMPONENT_TOPICPUBLISHER: return ComponentTransformer.transformTopicPublisher(javaClass); case Info.COMPONENT_SQLSTATEMENT: return ComponentTransformer.transformSQLStatement(javaClass); case Info.COMPONENT_SQLCONNECTION: return ComponentTransformer.transformSQLConnection(javaClass); default: return null; } } return null; }