📄 connectionnotification.java
字号:
/* * $Id: ConnectionNotification.java 12637 2008-09-12 17:34:03Z aperepel $ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */package org.mule.context.notification;import org.mule.api.context.notification.ServerNotification;import org.mule.api.transport.Connectable;/** * Is fired by a connector when a connection is made or disconnected. * A disconnection can be caused by network failure, JMX, or the server shutting down. */public class ConnectionNotification extends ServerNotification{ /** * Serial version */ private static final long serialVersionUID = -6455441938378523145L; public static final int CONNECTION_CONNECTED = CONNECTION_EVENT_ACTION_START_RANGE + 1; public static final int CONNECTION_FAILED = CONNECTION_EVENT_ACTION_START_RANGE + 2; public static final int CONNECTION_DISCONNECTED = CONNECTION_EVENT_ACTION_START_RANGE + 3; static { registerAction("connected", CONNECTION_CONNECTED); registerAction("connect failed", CONNECTION_FAILED); registerAction("disconnected", CONNECTION_DISCONNECTED); } public ConnectionNotification(Connectable resource, String identifier, int action) { super(resource, action); resourceIdentifier = identifier; } protected String getPayloadToString() { if (source instanceof Connectable) { return ((Connectable) source).getConnectionDescription(); } return source.toString(); } public String getType() { if (action == CONNECTION_DISCONNECTED) { return TYPE_WARNING; } if (action == CONNECTION_FAILED) { return TYPE_ERROR; } return TYPE_INFO; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -