本文整理汇总了Java中org.jivesoftware.util.Log.info方法的典型用法代码示例。如果您正苦于以下问题:Java Log.info方法的具体用法?Java Log.info怎么用?Java Log.info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jivesoftware.util.Log
的用法示例。
在下文中一共展示了Log.info方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: log
import org.jivesoftware.util.Log; //导入方法依赖的package包/类
private void log(String str, SSLEngineResult result) {
if (!logging) {
return;
}
if (resultOnce) {
resultOnce = false;
Log.info("The format of the SSLEngineResult is: \n"
+ "\t\"getStatus() / getHandshakeStatus()\" +\n"
+ "\t\"bytesConsumed() / bytesProduced()\"\n");
}
HandshakeStatus hsStatus = result.getHandshakeStatus();
Log.info(str + result.getStatus() + "/" + hsStatus + ", " + result.bytesConsumed() + "/"
+ result.bytesProduced() + " bytes");
if (hsStatus == HandshakeStatus.FINISHED) {
Log.info("\t...ready for application data");
}
}
示例2: exceptionCaught
import org.jivesoftware.util.Log; //导入方法依赖的package包/类
@Override
public void exceptionCaught(IoSession session, Throwable cause) throws Exception {
if (cause instanceof IOException) {
// TODO Verify if there were packets pending to be sent and decide what to do with them
Log.info("ConnectionHandler reports IOException for session: " + session, cause);
}
else if (cause instanceof ProtocolDecoderException) {
Log.warn("Closing session due to exception: " + session, cause);
// PIO-524: Determine stream:error message.
final StreamError error;
if (cause.getCause() != null && cause.getCause() instanceof XMLNotWellFormedException) {
error = new StreamError(StreamError.Condition.xml_not_well_formed);
} else {
error = new StreamError(StreamError.Condition.internal_server_error);
}
final Connection connection = (Connection) session.getAttribute(CONNECTION);
connection.deliverRawText(error.toXML());
session.close();
}
else {
Log.error("ConnectionHandler reports unexpected exception for session: " + session, cause);
}
}
示例3: append
import org.jivesoftware.util.Log; //导入方法依赖的package包/类
@Override
protected void append(LoggingEvent event)
{
final Level l = event.getLevel();
final String message = (event.getMessage() != null ? event.getMessage().toString() : "");
Throwable throwable = null;
if (event.getThrowableInformation() != null)
{
throwable = event.getThrowableInformation().getThrowable();
}
switch (l.toInt())
{
case Priority.OFF_INT:
// Logging turned off - do nothing.
break;
case Priority.FATAL_INT:
case Priority.ERROR_INT:
Log.error(message, throwable);
break;
case Priority.WARN_INT:
Log.warn(message, throwable);
break;
case Priority.INFO_INT:
Log.info(message, throwable);
break;
default:
// DEBUG and below (trace, all)
Log.debug(message, throwable);
break;
}
}
示例4: initializePlugin
import org.jivesoftware.util.Log; //导入方法依赖的package包/类
public void initializePlugin(PluginManager manager, File pluginDirectory) {
Log.info("ServerInfo - Starting plugin.");
Log.debug("ServerInfo - Starting plugin.");
pluginManager = manager;
sessionManager = SessionManager.getInstance();
String serverInfoPort = JiveGlobals.getProperty(SERVERINFOPORT, "4455");
userManager = UserManager.getInstance();
// Register as a component.
componentManager = ComponentManagerFactory.getComponentManager();
try {
componentManager.addComponent(serviceName, this);
}
catch (Exception e) {
Log.error(e.getMessage(), e);
}
PropertyEventDispatcher.addListener(this);
Log.info("ServerInfo - Starting bind on port " + serverInfoPort + ".");
Log.debug("ServerInfo - Starting bind on port " + serverInfoPort + ".");
ofd_srv.startServer();
}
示例5: destroyPlugin
import org.jivesoftware.util.Log; //导入方法依赖的package包/类
public void destroyPlugin() {
Log.info("ServerInfo - Closing plugin.");
Log.debug("ServerInfo - Closing plugin.");
PropertyEventDispatcher.removeListener(this);
// Unregister component.
if (componentManager != null) {
try {
componentManager.removeComponent(serviceName);
}
catch (Exception e) {
Log.error(e.getMessage(), e);
}
}
serviceName = JiveGlobals.getProperty("plugin.serverinfo.serviceName", "");
componentManager = null;
userManager = null;
pluginManager = null;
sessionManager = null;
Log.info("ServerInfo - Closing thread.");
Log.debug("ServerInfo - Closing thread.");
clientConnect();
ServerInfoPlugin.NotExit=false;
ServerInfoPlugin.ofThread.stop();
Log.info("ServerInfo - Thread closed.");
Log.debug("ServerInfo - Thread closed.");
}
示例6: shutdown
import org.jivesoftware.util.Log; //导入方法依赖的package包/类
public void shutdown() {
Log.info("ServerInfo - Shutdown thread.");
Log.debug("ServerInfo - Shutdown thread.");
clientConnect();
ServerInfoPlugin.NotExit=false;
ServerInfoPlugin.ofThread.stop();
Log.info("ServerInfo - Thread closed.");
Log.debug("ServerInfo - Thread closed.");
}
示例7: initializePlugin
import org.jivesoftware.util.Log; //导入方法依赖的package包/类
public void initializePlugin(PluginManager manager, File pluginDirectory) {
Log.info("B9 - Starting plugin.");
Log.debug("B9 - Starting plugin.");
pluginManager = manager;
sessionManager = SessionManager.getInstance();
userManager = UserManager.getInstance();
// Register as a component.
componentManager = ComponentManagerFactory.getComponentManager();
try {
componentManager.addComponent(serviceName, this);
}
catch (Exception e) {
Log.error(e.getMessage(), e);
}
PropertyEventDispatcher.addListener(this);
if (b9SocketEnabled) {
Log.info("B9 - Starting bind on port " + b9Port + ".");
Log.debug("B9 - Starting bind on port " + b9Port + ".");
b9d_srv.startServer();
}
}
示例8: destroyPlugin
import org.jivesoftware.util.Log; //导入方法依赖的package包/类
public void destroyPlugin() {
Log.info("B9 - Closing plugin.");
Log.debug("B9 - Closing plugin.");
PropertyEventDispatcher.removeListener(this);
// Unregister component.
if (componentManager != null) {
try {
componentManager.removeComponent(serviceName);
}
catch (Exception e) {
Log.error(e.getMessage(), e);
}
}
serviceName = JiveGlobals.getProperty("plugin.b9.serviceName", "");
componentManager = null;
userManager = null;
pluginManager = null;
sessionManager = null;
Log.info("B9 - Closing plugin.");
Log.debug("B9 - Closing plugin.");
if (b9SocketEnabled) {
clientConnect();
B9Plugin.NotExit=false;
B9Plugin.ofThread.stop();
Log.info("B9 - Thread closed.");
Log.debug("B9 - Thread closed.");
}
}
示例9: shutdown
import org.jivesoftware.util.Log; //导入方法依赖的package包/类
public void shutdown() {
Log.info("B9 - Shutdown thread.");
Log.debug("B9 - Shutdown thread.");
if (b9SocketEnabled) {
clientConnect();
B9Plugin.NotExit=false;
B9Plugin.ofThread.stop();
Log.info("B9 - Thread closed.");
Log.debug("B9 - Thread closed.");
}
}
示例10: append
import org.jivesoftware.util.Log; //导入方法依赖的package包/类
@Override
protected void append(LoggingEvent event)
{
final Level l = event.getLevel();
final String message = (event.getMessage() != null ? event.getMessage().toString() : "");
Throwable throwable = null;
if (event.getThrowableInformation() != null)
{
throwable = event.getThrowableInformation().getThrowable();
}
switch (l.toInt())
{
case Priority.OFF_INT:
// Logging turned off - do nothing.
break;
case Priority.FATAL_INT:
case Priority.ERROR_INT:
Log.error(message, throwable);
break;
case Priority.WARN_INT:
Log.warn(message, throwable);
break;
case Priority.INFO_INT:
Log.info(message, throwable);
break;
default:
// DEBUG and below (trace, all)
Log.debug(message, throwable);
break;
}
}
示例11: memberJoined
import org.jivesoftware.util.Log; //导入方法依赖的package包/类
public void memberJoined(MemberEvent memberEvent) {
if (memberEvent.isLocal()) {
done = false;
// We left and re-joined the cluster
Log.info("Rejoining cluster as node: " + new UID(CacheFactory.getClusterMemberID()) + ". Senior Member: " +
(CacheFactory.isSeniorClusterMember() ? "YES" : "NO"));
// Simulate insert events of existing cache content
simuateCacheInserts(C2SCache);
simuateCacheInserts(anonymousC2SCache);
simuateCacheInserts(S2SCache);
simuateCacheInserts(componentsCache);
simuateCacheInserts(componentSessionsCache);
simuateCacheInserts(multiplexerSessionsCache);
simuateCacheInserts(incomingServerSessionsCache);
simuateCacheInserts(directedPresencesCache);
// Set the new ID of this cluster node
XMPPServer.getInstance().setNodeID(NodeID.getInstance(CacheFactory.getClusterMemberID()));
// Trigger events
ClusterManager.fireJoinedCluster(true);
if (CacheFactory.isSeniorClusterMember()) {
seniorClusterMember = true;
ClusterManager.fireMarkedAsSeniorClusterMember();
}
}
else {
nodePresences.put(NodeID.getInstance(memberEvent.getMember().getUid().toByteArray()),
new ConcurrentHashMap<String, Collection<String>>());
// Trigger event that a new node has joined the cluster
ClusterManager.fireJoinedCluster(memberEvent.getMember().getUid().toByteArray(), true);
}
}
示例12: startServer
import org.jivesoftware.util.Log; //导入方法依赖的package包/类
public void startServer() {
Runnable serverTask = new Runnable() {
@Override
public void run() {
String serverInfoPort = JiveGlobals.getProperty(SERVERINFOPORT, "4455");
String serverInfoIP = JiveGlobals.getProperty(SERVERINFOIP, "127.0.0.1");
try {
Log.info("ServerInfo - Opening socket in IP " + serverInfoIP + " port " + serverInfoPort + ".");
Log.debug("ServerInfo - Opening socket in IP " + serverInfoIP + " port " + serverInfoPort + ".");
ServerSocket serverSocket = new ServerSocket(Integer.parseInt(serverInfoPort),1,InetAddress.getByName(serverInfoIP));
Log.info("ServerInfo - Waiting for connection.");
Log.debug("ServerInfo - Listen on IP " + serverInfoIP + " port " + serverInfoPort + ".");
Log.debug("Waiting for connection.");
while (ServerInfoPlugin.NotExit) {
Socket clientSocket = serverSocket.accept();
String input="";
String line;
try {
// Get input from the client
DataInputStream in = new DataInputStream (clientSocket.getInputStream());
PrintStream out = new PrintStream(clientSocket.getOutputStream());
input = "";
while((line = in.readLine()) != null && !line.equals(".")) {
input=input + line;
MyMessage_OF MyMsg = new MyMessage_OF();
Log.debug("ServerInfo - Receive socket message: " + input);
String text = MyMsg.returnMessage(input);
out.println(text);
input = "";
if (!ServerInfoPlugin.NotExit) {
Log.info("ServerInfo - Receive signal to close thread.");
Log.debug("ServerInfo - Receive signal to close thread.");
break;
}
}
clientSocket.close();
} catch (IOException ioe) {
Log.error("ServerInfo - IOException on socket listen: " + ioe);
ioe.printStackTrace();
}
}
Log.info("ServerInfo - Thread closing.");
Log.debug("ServerInfo - Thread closing.");
}
catch (IOException e) {
Log.error("ServerInfo - Unable to process client request");
e.printStackTrace();
}
}
};
ServerInfoPlugin.ofThread = new Thread(serverTask);
ServerInfoPlugin.ofThread.start();
Log.info("ServerInfo - Thread Created.");
Log.debug("ServerInfo - Thread Created.");
}
示例13: startCluster
import org.jivesoftware.util.Log; //导入方法依赖的package包/类
public boolean startCluster() {
ClassLoader oldLoader = null;
// Set that we are starting up the cluster service
state = State.starting;
try {
// Store previous class loader (in case we change it)
oldLoader = Thread.currentThread().getContextClassLoader();
// See if the license allows for additional cluster members.
int allowedMembers = getMaxClusterNodes();
// If more than 1 cluster member is allowed...
if (allowedMembers > 1) {
ClassLoader loader = new ClusterClassLoader();
Thread.currentThread().setContextClassLoader(loader);
cluster = com.tangosol.net.CacheFactory.ensureCluster();
// Make sure Coherence uses the correct class loader.
cluster.setContextClassLoader(loader);
int memberCount = cluster.getMemberSet().size();
// See if adding this cluster bumps us over the allowed
// number. If so, shut down the cluster and use local cache.
if (memberCount > allowedMembers) {
com.tangosol.net.CacheFactory.shutdown();
cluster = null;
Log.error("Error joining clustered cache: your "
+ "license only allows for " + allowedMembers +
" cluster nodes. Using local cache instead.");
}
else {
com.tangosol.net.CacheFactory.getCache("opt-$cacheStats");
taskService = com.tangosol.net.CacheFactory.getInvocationService("OpenFire Cluster Service");
// Update the running state of the cluster
state = cluster != null ? State.started : State.stopped;
Member localMember = cluster.getLocalMember();
Member seniorMember = cluster.getOldestMember();
// Set the ID of this cluster node
XMPPServer.getInstance().setNodeID(NodeID.getInstance(getClusterMemberID()));
// Trigger cluster events
ClusterManager.fireJoinedCluster(false);
// CacheFactory is now using clustered caches. We can add our listeners.
clusterListener = new ClusterListener();
taskService.addMemberListener(clusterListener);
if (isSeniorClusterMember()) {
ClusterManager.fireMarkedAsSeniorClusterMember();
}
Log.info("Joining cluster as node: " + localMember.getUid() + ". Senior Member: " +
(localMember == seniorMember ? "YES" : "NO"));
}
}
// Only 1 cluster member is allowed, so use local cache.
else {
Log.error("Error joining clustered cache: your " +
"license only allows for " + allowedMembers +
" cluster nodes. Using local cache instead.");
}
return cluster != null;
}
catch (Exception e) {
Log.error("Unable to start clustering - continuing in local mode", e);
}
finally {
if (oldLoader != null) {
// Restore previous class loader
Thread.currentThread().setContextClassLoader(oldLoader);
}
}
// For some reason the cluster was not started so update the status
state = State.stopped;
return false;
}
示例14: memberLeft
import org.jivesoftware.util.Log; //导入方法依赖的package包/类
public void memberLeft(MemberEvent memberEvent) {
byte[] nodeID = memberEvent.getMember().getUid().toByteArray();
if (memberEvent.isLocal()) {
Log.info("Leaving cluster");
// This node may have realized that it got kicked out of the cluster
seniorClusterMember = false;
// Clean up all traces. This will set all remote sessions as unavailable
List<NodeID> nodeIDs = new ArrayList<NodeID>(nodeSessions.keySet());
// Revert cluster caches to local caches
CacheFactory.leftCluster();
// Trigger event. Wait until the listeners have processed the event. Caches will be populated
// again with local content.
ClusterManager.fireLeftCluster();
if (!XMPPServer.getInstance().isShuttingDown()) {
for (NodeID key : nodeIDs) {
// Clean up directed presences sent from entites hosted in the leaving node to local entities
// Clean up directed presences sent to entites hosted in the leaving node from local entities
cleanupDirectedPresences(key);
// Clean up no longer valid sessions
cleanupPresences(key);
}
// Remove traces of directed presences sent from local entities to handlers that no longer exist
// At this point c2s sessions are gone from the routing table so we can identify expired sessions
XMPPServer.getInstance().getPresenceUpdateHandler().removedExpiredPresences();
}
// Mark that we are done with the clean up
done = true;
}
else {
// Trigger event that a node left the cluster
ClusterManager.fireLeftCluster(nodeID);
// Clean up directed presences sent from entites hosted in the leaving node to local entities
// Clean up directed presences sent to entites hosted in the leaving node from local entities
cleanupDirectedPresences(NodeID.getInstance(nodeID));
if (!seniorClusterMember && CacheFactory.isSeniorClusterMember()) {
seniorClusterMember = true;
ClusterManager.fireMarkedAsSeniorClusterMember();
}
if (CacheFactory.isSeniorClusterMember()) {
cleanupNode(NodeID.getInstance(nodeID));
}
// Remove traces of directed presences sent from local entities to handlers that no longer exist.
// At this point c2s sessions are gone from the routing table so we can identify expired sessions
XMPPServer.getInstance().getPresenceUpdateHandler().removedExpiredPresences();
}
// Delete nodeID instance (release from memory)
NodeID.deleteInstance(nodeID);
}
示例15: startCluster
import org.jivesoftware.util.Log; //导入方法依赖的package包/类
public boolean startCluster() {
ClassLoader oldLoader = null;
// Set that we are starting up the cluster service
state = State.starting;
// Set the serialization strategy to use for transmitting objects between node clusters
serializationStrategy = ExternalizableUtil.getInstance().getStrategy();
ExternalizableUtil.getInstance().setStrategy(new CoherenceExternalizableUtil());
// Set session locator to use when in a cluster
XMPPServer.getInstance().setRemoteSessionLocator(new RemoteSessionLocator());
// Set packet router to use to deliver packets to remote cluster nodes
XMPPServer.getInstance().getRoutingTable().setRemotePacketRouter(new CoherencePacketRouter());
// Initialize the Coherence cluster configuration
try {
// Store previous class loader (in case we change it)
oldLoader = Thread.currentThread().getContextClassLoader();
// See if the license allows for additional cluster members.
int allowedMembers = getMaxClusterNodes();
// If more than 1 cluster member is allowed...
if (allowedMembers > 1) {
ClassLoader loader = new ClusterClassLoader();
Thread.currentThread().setContextClassLoader(loader);
cluster = com.tangosol.net.CacheFactory.ensureCluster();
// Make sure Coherence uses the correct class loader.
cluster.setContextClassLoader(loader);
int memberCount = cluster.getMemberSet().size();
// See if adding this cluster bumps us over the allowed
// number. If so, shut down the cluster and use local cache.
if (memberCount > allowedMembers) {
com.tangosol.net.CacheFactory.shutdown();
cluster = null;
Log.error("Error joining clustered cache: your "
+ "license only allows for " + allowedMembers +
" cluster nodes. Using local cache instead.");
}
else {
com.tangosol.net.CacheFactory.getCache("opt-$cacheStats");
taskService = (InvocationService) com.tangosol.net.CacheFactory.getService("OpenFire Cluster Service");
// Update the running state of the cluster
state = cluster != null ? State.started : State.stopped;
Member localMember = cluster.getLocalMember();
Member seniorMember = cluster.getOldestMember();
// Set the ID of this cluster node
XMPPServer.getInstance().setNodeID(NodeID.getInstance(getClusterMemberID()));
// Trigger cluster events
ClusterManager.fireJoinedCluster(false);
// CacheFactory is now using clustered caches. We can add our listeners.
clusterListener = new ClusterListener();
taskService.addMemberListener(clusterListener);
if (isSeniorClusterMember()) {
ClusterManager.fireMarkedAsSeniorClusterMember();
}
Log.info("Joining cluster as node: " + localMember.getUid() + ". Senior Member: " +
(localMember == seniorMember ? "YES" : "NO"));
}
}
// Only 1 cluster member is allowed, so use local cache.
else {
Log.error("Error joining clustered cache: your " +
"license only allows for " + allowedMembers +
" cluster nodes. Using local cache instead.");
}
return cluster != null;
}
catch (Exception e) {
Log.error("Unable to start clustering - continuing in local mode", e);
}
finally {
if (oldLoader != null) {
// Restore previous class loader
Thread.currentThread().setContextClassLoader(oldLoader);
}
}
// For some reason the cluster was not started so update the status
state = State.stopped;
return false;
}