本文整理了Java中org.webpieces.util.logging.Logger.info()
方法的一些代码示例,展示了Logger.info()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.info()
方法的具体详情如下:
包路径:org.webpieces.util.logging.Logger
类名称:Logger
方法名:info
[英]Log a message at the INFO level.
[中]在信息级别记录消息。
代码示例来源:origin: org.webpieces/core-util
private static void logSuppressed(Throwable[] suppressed) {
for(Throwable s: suppressed) {
log.info("SUPPRESSED exception(meaning it's secondary after a main failure", s);
}
}
代码示例来源:origin: org.webpieces/http-router
protected void runStartupHooks(Injector injector) {
log.info("Running startup hooks for server");
Key<Set<Startable>> key = Key.get(new TypeLiteral<Set<Startable>>(){});
Set<Startable> startupHooks = injector.getInstance(key);
for(Startable s : startupHooks) {
runStartupHook(s);
}
log.info("Ran all startup hooks");
}
代码示例来源:origin: org.webpieces/plugin-hibernate
@Singleton
@Provides
public EntityManagerFactory providesSessionFactory() throws IOException {
log.info("Loading Hibernate. ENTITY classloader="+entityClassLoader+" hibernate classloader="+this.getClass().getClassLoader());
Map<String, Object> properties = createClassLoaderProperty();
EntityManagerFactory factory = Persistence.createEntityManagerFactory(persistenceUnit, properties );
log.info("Done loading Hibernate");
return factory;
}
代码示例来源:origin: org.webpieces/hibernate-plugin
@Singleton
@Provides
public EntityManagerFactory providesSessionFactory() throws IOException {
log.info("Loading Hibernate. ENTITY classloader="+entityClassLoader+" hibernate classloader="+this.getClass().getClassLoader());
Map<String, Object> properties = createClassLoaderProperty();
EntityManagerFactory factory = Persistence.createEntityManagerFactory(persistenceUnit, properties );
log.info("Done loading Hibernate");
return factory;
}
代码示例来源:origin: org.webpieces/http-frontend
@Override
public void failure(Channel channel, ByteBuffer data, Exception e) {
log.info("Failure on channel="+channel, e);
channel.close();
}
代码示例来源:origin: org.webpieces/embeddablehttpproxy
@Override
public void start() {
log.info("starting server");
InetSocketAddress addr = new InetSocketAddress(8080);
FrontendConfig config = new FrontendConfig("httpProxy", addr);
config.asyncServerConfig.functionToConfigureBeforeBind = s -> s.socket().setReuseAddress(true);
httpServer = serverMgr.createHttpServer(config, serverListener);
// InetSocketAddress sslAddr = new InetSocketAddress(8443);
// httpsServer = serverMgr.createTcpServer("httpsProxy", sslAddr, sslServerListener);
log.info("now listening for incoming connections");
}
代码示例来源:origin: org.webpieces/http-frontend
private void sendBadResponse(Channel channel, HttpException exc) {
try {
processor.sendServerException(channel, exc);
} catch(Throwable e) {
log.info("Could not send response to client", e);
}
}
代码示例来源:origin: org.webpieces/core-util
@Override
public void release() {
log.info("key:"+key+" Exit async sync block");
permitQueue.releasePermit();
}
}
代码示例来源:origin: org.webpieces/core-channelmanager2
@Override
public CompletableFuture<Void> sendEncryptedHandshakeData(ByteBuffer engineToSocketData) {
try {
return realChannel.write(engineToSocketData);
} catch(NioClosedChannelException e) {
log.info("Remote end closed before handshake was finished. (nothing we can do about that)");
return CompletableFuture.completedFuture(null);
}
}
代码示例来源:origin: org.webpieces/hibernate-plugin
private Action commitOrRollback(EntityManager em, Action action, Throwable t) {
EntityTransaction tx = em.getTransaction();
if(t != null) {
log.info("Transaction being rolled back");
rollbackTx(t, tx);
closeEm(t, em);
throw new RuntimeException(t);
}
log.info("Transaction being committed");
commit(tx, em);
return action;
}
代码示例来源:origin: org.webpieces/embeddablehttpproxy
public void processResponse(ResponseSender responseSender, HttpRequest req, HttpResponse resp, RequestId requestId, ResponseId incomingResponseId, boolean isComplete) {
log.info("received response(responseSender="+responseSender+"). type="+resp.getClass().getSimpleName()+" complete="+isComplete+" resp=\n"+resp);
responseSender.sendResponse(resp, req, requestId, isComplete)
.thenAccept(outgoingResponseId -> {
wroteBytes(responseSender);
incomingResponseToOutgoingResponseMap.put(incomingResponseId, outgoingResponseId);
})
.exceptionally(e -> failedWrite(responseSender, e));
}
代码示例来源:origin: org.webpieces/http-frontend
@Override
public void runImpl() {
socketToTimeout.remove(httpSocket);
log.info("timing out a client that did not send a request in time="+config.maxConnectToRequestTimeoutMs+"ms so we are closing that client's socket. httpSocket="+ httpSocket);
HttpClientException exc = new HttpClientException("timing out a client who did not send a request in time", KnownStatusCode.HTTP_408_REQUEST_TIMEOUT);
incomingError(exc, httpSocket);
}
}
代码示例来源:origin: org.webpieces/http-router-dev
@Override
public void start() {
log.info("Starting DEVELOPMENT server with CompilingClassLoader and HotSwap");
loadOrReload(injector -> runStartupHooks(injector));
started = true;
}
代码示例来源:origin: org.webpieces/embeddablehttpproxy
@Override
public void onRemoval(RemovalNotification<SocketAddress, HttpClientSocket> notification) {
log.info("closing socket="+notification.getKey()+". cache removal cause="+notification.getCause());
HttpClientSocket socket = notification.getValue();
socket.closeSocket();
}
}
代码示例来源:origin: org.webpieces/http-router
private void addStaticClasspathFile(String urlPath, String fileSystemPath) {
if(!fileSystemPath.startsWith("/"))
throw new IllegalArgumentException("Classpath resources must start with a / and be absolute on the classpath");
boolean isDirectory = fileSystemPath.endsWith("/");
VirtualFile file = new VirtualFileClasspath(fileSystemPath, getClass(), isDirectory);
StaticRoute route = new StaticRoute(new UrlPath(routerInfo, urlPath), file, true, holder.getCachedCompressedDirectory());
staticRoutes.add(route);
log.info("scope:'"+routerInfo+"' adding static route="+route.getFullPath()+" fileSystemPath="+route.getFileSystemPath());
RouteMeta meta = new RouteMeta(route, holder.getInjector(), currentPackage.get(), holder.getUrlEncoding());
allRouting.addStaticRoute(meta);
}
代码示例来源:origin: org.webpieces/http-frontend2
@Override
public void connectionOpened(TCPChannel channel, boolean isReadyForWrites) {
log.info(channel+" socket opened");
//when a channel is SSL, we can tell right away IF ALPN is installed
//boolean isHttp2 = channel.getAlpnDetails().isHttp2();
FrontendSocketImpl socket = new FrontendSocketImpl(channel, ProtocolType.UNKNOWN, svrSocketInfo);
channel.getSession().put(FRONTEND_SOCKET, socket);
http1_1Handler.socketOpened(socket, isReadyForWrites);
}
代码示例来源:origin: org.webpieces/http-router
private void setNotFoundRoute(Route r) {
if(!"".equals(this.routerInfo.getPath()))
throw new UnsupportedOperationException("setNotFoundRoute can only be called on the root Router, not a scoped router");
log.info("scope:'"+routerInfo+"' adding PAGE_NOT_FOUND route="+r.getFullPath()+" method="+r.getControllerMethodString());
RouteMeta meta = new RouteMeta(r, holder.getInjector(), currentPackage.get(), holder.getUrlEncoding());
holder.getFinder().loadControllerIntoMetaObject(meta, true);
domainRoutes.setPageNotFoundRoute(meta);
}
代码示例来源:origin: org.webpieces/http-router
private void addStaticLocalFile(String urlPath, String fileSystemPath) {
if(fileSystemPath.startsWith("/"))
throw new IllegalArgumentException("Absolute file system path is not supported as it is not portable across OS when done wrong. Override the modules working directory instead");
File workingDir = holder.getConfig().getWorkingDirectory();
VirtualFile file = VirtualFileFactory.newFile(workingDir, fileSystemPath);
StaticRoute route = new StaticRoute(new UrlPath(routerInfo, urlPath), file, false, holder.getCachedCompressedDirectory());
staticRoutes.add(route);
log.info("scope:'"+routerInfo+"' adding static route="+route.getFullPath()+" fileSystemPath="+route.getFileSystemPath());
RouteMeta meta = new RouteMeta(route, holder.getInjector(), currentPackage.get(), holder.getUrlEncoding());
allRouting.addStaticRoute(meta);
}
代码示例来源:origin: org.webpieces/http-frontend
@Override
public void incomingError(HttpException exc, HttpSocket httpSocket) {
listener.incomingError(exc, httpSocket);
//safety measure preventing leak on quick connect/close clients
releaseTimeout(httpSocket);
log.info("closing socket="+httpSocket+" due to response code="+exc.getStatusCode());
((HttpServerSocket) httpSocket).getResponseSender().close();
listener.channelClosed(httpSocket, false);
}
代码示例来源:origin: org.webpieces/http-frontend
void openedConnection(HttpServerSocket httpServerSocket, boolean isReadyForWrites) {
log.info("opened connection from " + httpServerSocket + " isReadyForWrites=" + isReadyForWrites);
if(!httpServerSocket.getUnderlyingChannel().isSslChannel()) {
scheduleTimeout(httpServerSocket);
clientOpenChannel(httpServerSocket);
} else if(isReadyForWrites) {
//if ready for writes, the tcpChannel is encrypted and fully open
clientOpenChannel(httpServerSocket);
} else { //if not ready for writes, the socket is open but encryption handshake is not been done yet
scheduleTimeout(httpServerSocket);
}
}
内容来源于网络,如有侵权,请联系作者删除!