void executorUntick(Object opened) { // just like resourceUntick - except we allow tasks to be submitted after close begins. int old; do { old = resourceCountUpdater.get(this); if (old == CLOSED_FLAG) { throw new RejectedExecutionException("Endpoint is not open"); } } while (! resourceCountUpdater.compareAndSet(this, old, old + 1)); if (log.isTraceEnabled()) { log.tracef("Allocated tick to %d of %s (opened %s)", Integer.valueOf(old + 1), this, opened); } }
private static void dump(Document document) { if ( !log.isTraceEnabled() ) { return; } final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final Writer w = new PrintWriter( baos ); try { final XMLWriter xw = new XMLWriter( w, new OutputFormat( " ", true ) ); xw.write( document ); w.flush(); } catch (IOException e1) { throw new RuntimeException( "Error dumping enhanced class", e1 ); } log.tracef( "Envers-generate entity mapping -----------------------------\n%s", baos.toString() ); log.trace( "------------------------------------------------------------" ); } }
@Override public boolean generateSchema(String persistenceUnitName, Map map) { log.tracef( "Starting generateSchema for persistenceUnitName %s", persistenceUnitName ); final EntityManagerFactoryBuilder builder = getEntityManagerFactoryBuilderOrNull( persistenceUnitName, map ); if ( builder == null ) { log.trace( "Could not obtain matching EntityManagerFactoryBuilder, returning false" ); return false; } builder.generateSchema(); return true; }
public void handleMessage(Channel channel, MessageInputStream messageInputStream) { DataInputStream dis = new DataInputStream(messageInputStream); try { log.tracef("Bytes Available %d", dis.available()); byte[] firstThree = new byte[3]; dis.read(firstThree); log.tracef("First Three %s", new String(firstThree)); if (Arrays.equals(firstThree, "JMX".getBytes()) == false) { throw new IOException("Invalid leading bytes in header."); } log.tracef("Bytes Available %d", dis.available()); String connectionId = dis.readUTF(); future.setResult(connectionId); } catch (IOException e) { future.setException(e); } finally { IoUtils.safeClose(dis); } }
@Override public void handle(DataInput input, int correlationId) throws IOException { log.trace("GetMBeanInfo"); byte paramType = input.readByte(); if (paramType != OBJECT_NAME) { throw new IOException("Unexpected paramType"); } Unmarshaller unmarshaller = prepareForUnMarshalling(input); ObjectName objectName; try { objectName = unmarshaller.readObject(ObjectName.class); } catch (ClassNotFoundException cnfe) { throw new IOException(cnfe); } try { MBeanInfo info = server.getMBeanServerConnection().getMBeanInfo(objectName); writeResponse(info, MBEAN_INFO, GET_MBEAN_INFO, correlationId); log.tracef("[%d] GetMBeanInfo - Success Response Sent", correlationId); } catch (IntrospectionException e) { writeResponse(e, MBEAN_INFO, correlationId); log.tracef("[%d] GetMBeanInfo - Failure Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, MBEAN_INFO, correlationId); log.tracef("[%d] GetMBeanInfo - Failure Response Sent", correlationId); } catch (ReflectionException e) { writeResponse(e, MBEAN_INFO, correlationId); log.tracef("[%d] GetMBeanInfo - Failure Response Sent", correlationId); } }
public void handleMessage(Channel channel, MessageInputStream messageInputStream) { DataInputStream dis = new DataInputStream(messageInputStream); try { log.tracef("Bytes Available %d", dis.available()); byte[] firstThree = new byte[3]; dis.read(firstThree); log.tracef("First Three %s", new String(firstThree)); if (Arrays.equals(firstThree, "JMX".getBytes()) == false) { throw new IOException("Invalid leading bytes in header."); } future.setResult(null); } catch (IOException e) { future.setException(e); } finally { IoUtils.safeClose(dis); } }
@Override public void handle(DataInput input, int correlationId) throws IOException { log.trace("UnregisterMBean"); byte paramType = input.readByte(); if (paramType != OBJECT_NAME) { throw new IOException("Unexpected paramType"); } Unmarshaller unmarshaller = prepareForUnMarshalling(input); ObjectName objectName; try { objectName = unmarshaller.readObject(ObjectName.class); } catch (ClassNotFoundException cnfe) { throw new IOException(cnfe); } try { server.getMBeanServerConnection().unregisterMBean(objectName); writeResponse(UNREGISTER_MBEAN, correlationId); log.tracef("[%d] UnregisterMBean - Success Response Sent", correlationId); } catch (MBeanRegistrationException e) { writeResponse(e, UNREGISTER_MBEAN, correlationId); log.tracef("[%d] UnregisterMBean - Failure Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, UNREGISTER_MBEAN, correlationId); log.tracef("[%d] UnregisterMBean - Failure Response Sent", correlationId); } }
void resourceUntick(Object opened) throws NotOpenException { int old; do { old = resourceCountUpdater.get(this); if ((old & CLOSED_FLAG) != 0) { throw new NotOpenException("Endpoint is not open"); } } while (! resourceCountUpdater.compareAndSet(this, old, old + 1)); if (log.isTraceEnabled()) { log.tracef("Allocated tick to %d of %s (opened %s)", Integer.valueOf(old + 1), this, opened); } }
@Override public void handle(DataInput input, final int correlationId) throws IOException { log.trace("GetDomains"); final String[] domains = server.getMBeanServerConnection().getDomains(); writeResponse(domains, GET_DOMAINS, correlationId); log.tracef("[%d] GetDomains - Success Response Sent", correlationId); }
LOG.tracef( "Beginning parsing of order-by fragment : " + fragment ); if ( LOG.isTraceEnabled() ) { LOG.trace( TokenPrinters.ORDERBY_FRAGMENT_PRINTER.showAsString( parser.getAST(), "--- {order-by fragment} ---" ) );
byte messageId = dis.readByte(); final int correlationId = dis.readInt(); log.tracef("Message Received id(%h), correlationId(%d)", messageId, correlationId); throw new IOException("Unrecognised Message ID");
@Override public void handle(DataInput input, final int correlationId) throws IOException { log.trace("GetAttribute"); throw new IOException("Unexpected paramType"); objectName = unmarshaller.readObject(ObjectName.class); } catch (ClassNotFoundException cnfe) { throw new IOException(cnfe); throw new IOException("Unexpected paramType"); log.tracef("[%d] GetAttribute - Success Response Sent", correlationId); } catch (AttributeNotFoundException e) { writeResponse(e, GET_ATTRIBUTE, correlationId); log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, GET_ATTRIBUTE, correlationId); log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId); } catch (MBeanException e) { writeResponse(e, GET_ATTRIBUTE, correlationId); log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId); } catch (ReflectionException e) { writeResponse(e, GET_ATTRIBUTE, correlationId); log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId);
@Override public void removeSingleSignOn(SingleSignOn sso) { if(log.isTraceEnabled()) { log.tracef("Removing SSO ID %s.", sso.getId()); } this.ssoEntries.remove(sso.getId()); }
@Override public void handle(DataInput input, final int correlationId) throws IOException { log.trace("GetDefaultDomain"); final String defaultDomain = server.getMBeanServerConnection().getDefaultDomain(); writeResponse(defaultDomain, GET_DEFAULT_DOMAIN, correlationId); log.tracef("[%d] CreateMBean - Success Response Sent", correlationId); } }
if ( LOG.isTraceEnabled() ) { LOG.trace( "Resolved natural key -> primary key resolution in session cache: " + persister.getRootEntityName() + "#[" + if ( LOG.isTraceEnabled() ) { LOG.tracef( "Found natural key [%s] -> primary key [%s] xref in second-level cache for %s", Arrays.toString( naturalIdValues ),
public Integer getMBeanCount() throws IOException { VersionedIoFuture<TypeExceptionHolder<Integer>> future = new VersionedIoFuture<TypeExceptionHolder<Integer>>(); final int correlationId = reserveNextCorrelationId(future); try { write(new MessageWriter() { @Override public void write(DataOutput output) throws IOException { output.writeByte(GET_MBEAN_COUNT); output.writeInt(correlationId); } }); log.tracef("[%d] getMBeanCount - Request Sent", correlationId); IoFuture.Status result = future.await(timeoutSeconds, TimeUnit.SECONDS); switch (result) { case DONE: TypeExceptionHolder<Integer> response = future.get(); if (response.e == null) { return response.value; } jmRuntimeException(response.e); throw toIoException(response.e); case FAILED: throw future.getException(); default: throw new IOException("Unable to obtain MBeanCount, status=" + result.toString()); } } finally { releaseCorrelationId(correlationId); } }
@Override public void handle(DataInput input, int correlationId) throws IOException { log.trace("GetObjectInstance"); byte paramType = input.readByte(); if (paramType != OBJECT_NAME) { throw new IOException("Unexpected paramType"); } Unmarshaller unmarshaller = prepareForUnMarshalling(input); ObjectName objectName; try { objectName = unmarshaller.readObject(ObjectName.class); } catch (ClassNotFoundException cnfe) { throw new IOException(cnfe); } try { ObjectInstance objectInstance = server.getMBeanServerConnection().getObjectInstance(objectName); writeResponse(objectInstance, OBJECT_INSTANCE, GET_OBJECT_INSTANCE, correlationId); log.tracef("[%d] GetObjectInstance - Success Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, GET_OBJECT_INSTANCE, correlationId); log.tracef("[%d] GetObjectInstance - Failure Response Sent", correlationId); } }
@Override public SingleSignOn createSingleSignOn(Account account, String mechanism) { String id = SECURE_RANDOM_SESSION_ID_GENERATOR.createSessionId(); SingleSignOn entry = new SimpleSingleSignOnEntry(id, account, mechanism); this.ssoEntries.put(id, entry); if(log.isTraceEnabled()) { log.tracef("Creating SSO ID %s for Principal %s and Roles %s.", id, account.getPrincipal().getName(), account.getRoles().toString()); } return entry; }
@Override public void handle(DataInput input, final int correlationId) throws IOException { log.trace("GetDomains"); final String[] domains = server.getMBeanServerConnection().getDomains(); writeResponse(domains, GET_DOMAINS, correlationId); log.tracef("[%d] GetDomains - Success Response Sent", correlationId); }