本文整理汇总了Java中sagex.plugin.SageEvents类的典型用法代码示例。如果您正苦于以下问题:Java SageEvents类的具体用法?Java SageEvents怎么用?Java SageEvents使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SageEvents类属于sagex.plugin包,在下文中一共展示了SageEvents类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onClientConnected
import sagex.plugin.SageEvents; //导入依赖的package包/类
@SageEvent(value=SageEvents.ClientConnected, background=true)
public void onClientConnected(Map args) {
//System.out.println("*****GEMSTONE onClientConnected - args '" + args + "' - " + util.LogInfo());
if (args.containsKey("MACAddress")){
if (args.get("MACAddress")==null){
LOG.debug("onClientConnected: MACAddress null so must be a PC client. Client will handle ClientStart. '" + args + "' " + util.LogInfo());
}else{
String tClient = args.get("MACAddress").toString();
if (NonPCClients.contains(tClient)){
LOG.debug("onClientConnected: client already loaded: '" + tClient + "' IP '" + args.get("IPAddress") + "' Client will handle ClientStart: " + util.LogInfo());
}else{
LOG.debug("onClientConnected: new client added: '" + tClient + "' IP '" + args.get("IPAddress") + "' Client will handle ClientStart: " + util.LogInfo());
NonPCClients.add(args.get("MACAddress").toString());
//api.clientStart() is called from the STV ApplicationStarted hook to ensure all prerequisites are loaded first
//api.ClientStart();
}
}
}else{
LOG.debug("onClientConnected: no MACAddress entry found'" + args + "' " + util.LogInfo());
}
}
示例2: onClientDisconnected
import sagex.plugin.SageEvents; //导入依赖的package包/类
@SageEvent(value=SageEvents.ClientDisconnected, background=true)
public void onClientDisconnected(Map args) {
LOG.debug("onClientDisconnected: called '" + args + "' " + util.LogInfo());
if (args.containsKey("MACAddress")){
if (args.get("MACAddress")==null){
LOG.debug("onClientDisconnected: MACAddress null so must be a PC client. Not running server side ClientExit. '" + args + "' " + util.LogInfo());
}else{
String tClient = args.get("MACAddress").toString();
if (NonPCClients.contains(tClient)){
LOG.debug("onClientDisconnected: client found and removed: '" + tClient + "' IP '" + args.get("IPAddress") + "' " + util.LogInfo());
NonPCClients.remove(tClient);
api.ClientExit(tClient);
}else{
LOG.debug("onClientDisconnected: client not found: '" + tClient + "' IP '" + args.get("IPAddress") + "' " + util.LogInfo());
}
}
}else{
LOG.debug("onClientDisconnected: no MACAddress entry found'" + args + "' " + util.LogInfo());
}
}
示例3: onPluginsLoaded
import sagex.plugin.SageEvents; //导入依赖的package包/类
@SageEvent(value = SageEvents.AllPluginsLoaded, background = true)
public void onPluginsLoaded() {
if (OneTimePluginLoadedComplete){
LOG.debug("onPluginsLoaded: Plugins previously loaded: " + util.LogInfo());
}else{
OneTimePluginLoadedComplete = true;
LOG.debug("onPluginsLoaded: All Plugins Loaded: " + util.LogInfo());
}
}
示例4: onPlaybackStopped
import sagex.plugin.SageEvents; //导入依赖的package包/类
@PhoenixEvent(SageEvents.PlaybackStopped)
public void onPlaybackStopped(Map args) {
String ctx = (String) args.get(UICONTEXT_ARG);
OnlineVideoPlayer player = players.get(ctx);
log.info("Playback Stopped for " + player);
if (player != null) {
setWatched(player.getMediaFile(), (Long) args.get(Duration_ARG), (Long) args.get(MEDIA_TIME_ARG));
destroyPlayer(ctx);
}
}
示例5: onPlaybackFinished
import sagex.plugin.SageEvents; //导入依赖的package包/类
@PhoenixEvent(SageEvents.PlaybackFinished)
public void onPlaybackFinished(Map args) {
String ctx = (String) args.get(UICONTEXT_ARG);
OnlineVideoPlayer player = players.get(ctx);
log.info("Playback Finished for " + player);
if (player != null) {
setWatched(player.getMediaFile(), (Long) args.get(Duration_ARG), (Long) args.get(MEDIA_TIME_ARG));
destroyPlayer(ctx);
}
}