Package org.ow2.asm.signature

Examples of org.ow2.asm.signature.SignatureWriter


    public String mapSignature(String signature, boolean typeSignature) {
        if (signature == null) {
            return null;
        }
        SignatureReader r = new SignatureReader(signature);
        SignatureWriter w = new SignatureWriter();
        SignatureVisitor a = createRemappingSignatureAdapter(w);
        if (typeSignature) {
            r.acceptType(a);
        } else {
            r.accept(a);
        }
        return w.toString();
    }
View Full Code Here


                String superName,
                String[] interfaces)
            {
                if (signature != null) {
                    SignatureReader sr = new SignatureReader(signature);
                    SignatureWriter sw = new SignatureWriter();
                    sr.accept(new CheckSignatureAdapter(CheckSignatureAdapter.CLASS_SIGNATURE,
                            sw));
                    assertEquals(signature, sw.toString());
                }
            }

            @Override
            public FieldVisitor visitField(
                int access,
                String name,
                String desc,
                String signature,
                Object value)
            {
                if (signature != null) {
                    SignatureReader sr = new SignatureReader(signature);
                    SignatureWriter sw = new SignatureWriter();
                    sr.acceptType(new CheckSignatureAdapter(CheckSignatureAdapter.TYPE_SIGNATURE,
                            sw));
                    assertEquals(signature, sw.toString());
                }
                return null;
            }

            @Override
            public MethodVisitor visitMethod(
                int access,
                String name,
                String desc,
                String signature,
                String[] exceptions)
            {
                if (signature != null) {
                    SignatureReader sr = new SignatureReader(signature);
                    SignatureWriter sw = new SignatureWriter();
                    sr.accept(new CheckSignatureAdapter(CheckSignatureAdapter.METHOD_SIGNATURE,
                            sw));
                    assertEquals(signature, sw.toString());
                }
                return null;
            }

        }, 0);
View Full Code Here

        super("testSignature");
        this.data = data;
    }

    public void testSignature() {
        SignatureWriter wrt = new SignatureWriter();
        SignatureReader rdr = new SignatureReader(data.signature);
        switch (data.type) {
            case 'C':
            case 'M':
                rdr.accept(wrt);
                break;
            case 'F':
                rdr.acceptType(wrt);
                break;
            default:
                return;
        }
        assertEquals(data.signature, wrt.toString());
    }
View Full Code Here

        super("checkSignature");
        this.data = data;
    }

    public void checkSignature() {
        SignatureWriter wrt = new SignatureWriter();
        SignatureReader rdr = new SignatureReader(data.signature);
        switch (data.type) {
            case 'C':
                rdr.accept(new CheckSignatureAdapter(CheckSignatureAdapter.CLASS_SIGNATURE,
                        wrt));
                break;
            case 'M':
                rdr.accept(new CheckSignatureAdapter(CheckSignatureAdapter.METHOD_SIGNATURE,
                        wrt));
                break;
            case 'F':
                rdr.acceptType(new CheckSignatureAdapter(CheckSignatureAdapter.TYPE_SIGNATURE,
                        wrt));
                break;
            default:
                return;
        }
        assertEquals(data.signature, wrt.toString());
    }
View Full Code Here

    public String mapSignature(String signature, boolean typeSignature) {
        if (signature == null) {
            return null;
        }
        SignatureReader r = new SignatureReader(signature);
        SignatureWriter w = new SignatureWriter();
        SignatureVisitor a = createRemappingSignatureAdapter(w);
        if (typeSignature) {
            r.acceptType(a);
        } else {
            r.accept(a);
        }
        return w.toString();
    }
View Full Code Here

            } catch (Exception e) {
                this.logger.error("Cannot configure Carol to use CMI", e);
                throw new EZBComponentException("Cannot configure Carol to use CMI", e);
            }

            ClusterViewManagerFactory clusterViewManagerFactory = ClusterViewManagerFactory.getFactory();

            // Start the manager
            try {
                this.clusterViewManager = (ServerClusterViewManager) clusterViewManagerFactory.create();
            } catch (Exception e) {
                this.logger.error("Cannot retrieve the CMI Server", e);
                throw new EZBComponentException("Cannot retrieve the CMI Server", e);
            }
            if (this.clusterViewManager != null
                    && this.clusterViewManager.getState().equals(ClusterViewManager.State.STOPPED)) {
                if (this.eventComponent != null) {
                    List<Component> components =
                        clusterViewManagerFactory.getConfig().getComponents().getComponents();
                    if (components != null) {
                        for (Component cmiEventComponent : components) {
                            if (org.ow2.cmi.component.event.EventComponent.class.isAssignableFrom(cmiEventComponent.getClass())) {
                                ((org.ow2.cmi.component.event.EventComponent) cmiEventComponent).setEventService(
                                        this.eventComponent.getEventService());
View Full Code Here

            return EASYBEANS_ROOT;
        } else if (EZBContainer.class.isAssignableFrom(clazz)) {
            // The object is an EJB container.

            EZBContainer container = (EZBContainer) instance;

            // Get the archive name (remove all character before the last slash/antislash).
            String archiveName = container.getName().replaceAll("(.*[/\\\\])", "");

            // Compute the application id.
            return EASYBEANS_ROOT + "/" + container.getApplicationName() + "/" + archiveName;
        } else if (Factory.class.isAssignableFrom(clazz)) {
            // The object is a bean factory.

            Factory<?, ?> factory = (Factory<?, ?>) instance;
            EZBContainer container = factory.getContainer();

            // Get the archive name (remove all character before the last slash/antislash).
            String archiveName = container.getName().replaceAll("(.*[/\\\\])", "");

            // Get the bean class name (remove all character before the last point).
            String factoryName = factory.getClassName().replaceAll("(.*\\.)", "");

            // Compute the bean id.
            return EASYBEANS_ROOT + "/" + container.getApplicationName() + "/" + archiveName + "/" + factoryName;
        } else {
            throw new java.lang.IllegalArgumentException("Name is not define for argument of type " + instance.getClass());
        }
    }
View Full Code Here

                    throw new EZBComponentException("Cannot start the CMI Server", e);
                }
            }
        }
        // register the listener.
        EZBEventListener eventListener = new CmiEventListener();
        this.eventComponent.registerEventListener(eventListener);

        this.logger.debug("The CMI configuration extension has been added.");
    }
View Full Code Here

            public synchronized void handle(final IEvent event) {
                if (EZBEventBeanInvocationBegin.class.isAssignableFrom(event.getClass())) {
                    EZBEventBeanInvocationBegin e = (EZBEventBeanInvocationBegin) event;
                    MeanCallTimeStatistic.this.pendingCall.put(Long.valueOf(e.getInvocationNumber()), e);
                } else {
                    EZBEventBeanInvocation eventEnd = (EZBEventBeanInvocation) event;
                    EZBEventBeanInvocation eventBegin =
                        MeanCallTimeStatistic.this.pendingCall.remove(Long.valueOf(eventEnd.getInvocationNumber()));

                    MeanCallTimeStatistic.this.count++;
                    MeanCallTimeStatistic.this.total += eventEnd.getTime() - eventBegin.getTime();
                    setLastSampleTime(System.currentTimeMillis());
                }
            }
View Full Code Here

             * Handle the event.
             * @param event The event to handle.
             */
            public synchronized void handle(final IEvent event) {
                if (EZBEventBeanInvocationBegin.class.isAssignableFrom(event.getClass())) {
                    EZBEventBeanInvocationBegin e = (EZBEventBeanInvocationBegin) event;
                    MeanCallTimeStatistic.this.pendingCall.put(Long.valueOf(e.getInvocationNumber()), e);
                } else {
                    EZBEventBeanInvocation eventEnd = (EZBEventBeanInvocation) event;
                    EZBEventBeanInvocation eventBegin =
                        MeanCallTimeStatistic.this.pendingCall.remove(Long.valueOf(eventEnd.getInvocationNumber()));

View Full Code Here

TOP

Related Classes of org.ow2.asm.signature.SignatureWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.