private static void debug( final XMPPLogic logic, final Stanza msg ) { log.debug( "%s (%s -> %s) -> %s %s", msg.getClass(), msg.getFrom(), msg.getTo(), logic == null ? null : logic.getClass(), logic ); }
@PostConstruct public void start() throws NamingException { if( StringUtils.isStringEmpty( jndiName ) ) { throw new NullPointerException( "No jndiName defined" ); } if( value == null ) { throw new NullPointerException( "No bean available to bind to " + jndiName ); } JNDIUtils.bind( jndiName, value ); log.debug( "Bound %s", jndiName, value.getClass().getName() ); }
@PreDestroy public void stop() { if( StringUtils.isStringNotEmpty( jndiName ) && value != null ) { try { JNDIUtils.unbind( jndiName ); log.debug( "unbound %s", jndiName ); } catch( Exception ex ) { // ignore } } } }
@Override protected final void accept( SelectionKey key ) throws IOException { final ByteBuffer buffer = ByteBuffer.allocate( getDefaultCapacity() ); buffer.clear(); final ServerSocketChannel server = ServerSocketChannel.class.cast( key.channel() ); final SocketChannel channel = server.accept(); final SocketProcessorHandler handler = createSocketProcessorHandler( channel ); handler.accept( key ); getLog().debug( "Accepted connection from %s", channel.socket() ); registerChannel( channel, SelectionKey.OP_READ, buffer ); }
getLog().debug( "UP:%s, LB:%s, Virt:%s P2P:%s %s", ni.isUp(), ni.isLoopback(), ni.isVirtual(), ni.isPointToPoint(), ni );
private Unmarshaller createUnmarshaller() throws JAXBException { getLog().debug( "Creating Unmarshaller" ); final Unmarshaller unmarshaller = new UnmarshallerWrapper(); if( unmarshallerCallback != null ) { unmarshallerCallback.initialiseUnmarshaller( unmarshaller, this ); } return unmarshaller; }
private Marshaller createMarshaller() throws JAXBException { getLog().debug( "Creating Marshaller" ); final Marshaller marshaller = new MarshallerWrapper(); if( marshallerCallback != null ) { marshallerCallback.initialiseMarshaller( marshaller, this ); } return marshaller; }
public <D> void debug( final XMPPServer<D> server ) throws JAXBException { if( getLog().isDebugEnabled() ) { for( Iq iq : iqs ) { getLog().debug( server.marshallXml( iq ) ); } for( Message message : messages ) { getLog().debug( server.marshallXml( message ) ); } for( Presence presence : presences ) { getLog().debug( server.marshallXml( presence ) ); } } } }
@Override protected void initiate( final ResourceConfig rc, final WebApplication wa ) { try { // Add all classes discovered by the post processor to the ResourceConfig final Set<Class<?>> classes = Kernel.getInstance().<KernelComponentPostProcessor>getBean( PROCESSOR_BEAN ).getClasses(); log.debug( "Discovered %d provider/root classes", classes.size() ); rc.getClasses().addAll( classes ); log.debug( "%d provider/root classes in config", rc.getClasses().size() ); // Now initiate the WebApplication wa.initiate( rc, new KernelComponentProviderFactory() ); } catch( RuntimeException e ) { log.error( "Exception occurred when intialization", e ); throw e; } } }
log.debug( "Creating ReferenceQueue" );
private MucRoom getRoom( final MucService service, final Stanza message ) throws MessageException { final JID jid = message.getTo(); final MucRoom room = service.getRoomSet().get( jid.getNode() ); if( room == null ) { if( log.isDebugEnabled() ) { log.debug( "Room %s not found", jid ); } } else if( log.isDebugEnabled() ) { log.debug( "Room %s found", jid ); } return room; }
/** * Log the stanza if debugging is enabled. * * @param stanza */ protected final void logStanza( @Nonnull final Stanza stanza ) { if( getLog().isDebugEnabled() ) { try { // Marshall the entire stanza getLog().debug( getServer().marshallXml( stanza ) ); } catch( JAXBException je ) { // Fall back to the short method getLog().debug( XMPPUtil.toString( stanza ) ); } } }
getLog().debug( "Registering selector on serverChannel" ); serverChannel.register( selector, SelectionKey.OP_ACCEPT );
/** * DelayedRunnableThreadPoolExecutor used just for Reference's. This * ThreadPoolExecutor is used primarily by {@link DelayedWeakReference} * * @return DelayedRunnableThreadPoolExecutor */ public static synchronized DelayedRunnableThreadPoolExecutor getDelayThreadPoolExecutor() { if( delayPool == null ) { if( log.isDebugEnabled() ) { log.debug( "Creating DelayedRunnableThreadPoolExecutor" ); } delayPool = new DelayedRunnableThreadPoolExecutor( 1, 10, 5L, TimeUnit.MINUTES, getThreadFactory() ); // Ensure we have the core thread started else the first entry will // run immediately delayPool.prestartCoreThread(); } return delayPool; }