cometd-java/cometd-java-annotation/cometd-java-annotation-server/src/main/java/org/cometd/annotation/server/ServerAnnotationProcessor.java
/**
     * Processes the methods annotated with {@link Configure}.
     *
     * @param bean the annotated service instance
     * @return true if at least one annotated configure has been processed, false otherwise
     */
Processes the methods annotated with  Configure.
@param bean the annotated service instance
@return true if at least one annotated configure has been processed, false otherwise
Processes the methods annotated with Configure . @param bean the annotated service instance @return true if at least one annotated configure has been processed false otherwise
public boolean processConfigurations(Object bean) {
        if (bean == null) {
            return false;
        }
        Class<?> klass = bean.getClass();
        Service serviceAnnotation = klass.getAnnotation(Service.class);
        if (serviceAnnotation == null) {
            return false;
        }
        List<Method> methods = findAnnotatedMethods(bean, Configure.class);
        if (methods.isEmpty()) {
            return false;
        }
        for (Method method : methods) {
            Configure configure = method.getAnnotation(Configure.class);
            String[] channels = configure.value();
            for (String channelName : channels) {
                Initializer init = channel -> {
                    if (LOGGER.isDebugEnabled()) {
                        LOGGER.debug("Configure channel {} with method {} on bean {}", channel, method, bean);
                    }
                    invokePrivate(bean, method, channel);
                };
                MarkedReference<ServerChannel> initializedChannel = bayeuxServer.createChannelIfAbsent(channelName, init);
                if (!initializedChannel.isMarked()) {
                    if (configure.configureIfExists()) {
                        if (LOGGER.isDebugEnabled()) {
                            LOGGER.debug("Configure again channel {} with method {} on bean {}", channelName, method, bean);
                        }
                        init.configureChannel(initializedChannel.getReference());
                    } else if (configure.errorIfExists()) {
                        throw new IllegalStateException("Channel already configured: " + channelName);
                    } else {
                        if (LOGGER.isDebugEnabled()) {
                            LOGGER.debug("Channel {} already initialized. Not called method {} on bean {}", channelName, method, bean);
                        }
                    }
                }
            }
        }
        return true;
    }
public boolean processConfigurations ( Object bean ) { if ( bean == null ) { return false ; } Class < ? > klass = bean . getClass ( ) ; Service serviceAnnotation = klass . getAnnotation ( Service . class ) ; if ( serviceAnnotation == null ) { return false ; } List < Method > methods = findAnnotatedMethods ( bean , Configure . class ) ; if ( methods . isEmpty ( ) ) { return false ; } for ( Method method : methods ) { Configure configure = method . getAnnotation ( Configure . class ) ; String [ ] channels = configure . value ( ) ; for ( String channelName : channels ) { Initializer init = channel -> { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Configure channel {} with method {} on bean {}" , channel , method , bean ) ; } invokePrivate ( bean , method , channel ) ; } ; MarkedReference < ServerChannel > initializedChannel = bayeuxServer . createChannelIfAbsent ( channelName , init ) ; if ( ! initializedChannel . isMarked ( ) ) { if ( configure . configureIfExists ( ) ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Configure again channel {} with method {} on bean {}" , channelName , method , bean ) ; } init . configureChannel ( initializedChannel . getReference ( ) ) ; } else if ( configure . errorIfExists ( ) ) { throw new IllegalStateException ( "Channel already configured: " + channelName ) ; } else { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Channel {} already initialized. Not called method {} on bean {}" , channelName , method , bean ) ; } } } } } return true ; }
Processes the methods annotated with {@link Configure}.
Processes the methods annotated with { @link Configure } .