当前位置: 首页>>代码示例>>Java>>正文


Java ModelMBeanOperationInfo.ACTION属性代码示例

本文整理汇总了Java中javax.management.modelmbean.ModelMBeanOperationInfo.ACTION属性的典型用法代码示例。如果您正苦于以下问题:Java ModelMBeanOperationInfo.ACTION属性的具体用法?Java ModelMBeanOperationInfo.ACTION怎么用?Java ModelMBeanOperationInfo.ACTION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.management.modelmbean.ModelMBeanOperationInfo的用法示例。


在下文中一共展示了ModelMBeanOperationInfo.ACTION属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: tps

@RemoteMethod(description = "Get current server tps", impact = ModelMBeanOperationInfo.ACTION)
public double tps()
{
    try
    {
        double result = 0;
        double[] recentTps = (double[]) recentTpsField.get(getServerMethod.invoke(null));

        for(double one : recentTps)
            result += one;

        return result / recentTps.length;
    }
    catch (IllegalAccessException | InvocationTargetException e)
    {
        e.printStackTrace();
    }

    return 0;
}
 
开发者ID:SamaGames,项目名称:SamaGamesCore,代码行数:20,代码来源:ServerFunction.java

示例2: getMBeanInfo

@Override
public MBeanInfo getMBeanInfo() {
    try {
        ModelMBeanAttributeInfo[] attributes = new ModelMBeanAttributeInfo[0];
        ModelMBeanConstructorInfo[] constructors = new ModelMBeanConstructorInfo[] {
                new ModelMBeanConstructorInfo("-", this.getClass().getConstructor())
        };
        ModelMBeanOperationInfo[] operations = new ModelMBeanOperationInfo[] {
                new ModelMBeanOperationInfo("info", "-", new MBeanParameterInfo[0], Void.class.getName(), ModelMBeanOperationInfo.INFO),
                new ModelMBeanOperationInfo("action", "-", new MBeanParameterInfo[0], Void.class.getName(), ModelMBeanOperationInfo.ACTION),
                new ModelMBeanOperationInfo("actionInfo", "-", new MBeanParameterInfo[0], Void.class.getName(), ModelMBeanOperationInfo.ACTION_INFO),
                new ModelMBeanOperationInfo("unknown", "-", new MBeanParameterInfo[0], Void.class.getName(), ModelMBeanOperationInfo.UNKNOWN)
        };
        ModelMBeanNotificationInfo[] notifications = new ModelMBeanNotificationInfo[0];
        return new ModelMBeanInfoSupport(this.getClass().getName(), "-", attributes, constructors, operations, notifications);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:19,代码来源:TestModelMBean.java

示例3: addPlayer

@RemoteMethod(description = "Add a player to the whitelist", impact = ModelMBeanOperationInfo.ACTION)
public void addPlayer(UUID player)
{
    Bukkit.getWhitelistedPlayers().add(Bukkit.getOfflinePlayer(player));
    Bukkit.reloadWhitelist();
    Bukkit.getLogger().info("Added player " + player + " to whitelist");
}
 
开发者ID:SamaGames,项目名称:SamaGamesCore,代码行数:7,代码来源:WhitelistFunction.java

示例4: removePlayer

@RemoteMethod(description = "Remove a player to the whitelist", impact = ModelMBeanOperationInfo.ACTION)
public void removePlayer(UUID player)
{
    Bukkit.getWhitelistedPlayers().add(Bukkit.getOfflinePlayer(player));
    Bukkit.reloadWhitelist();
    Bukkit.getLogger().info("Added player " + player + " to whitelist");
}
 
开发者ID:SamaGames,项目名称:SamaGamesCore,代码行数:7,代码来源:WhitelistFunction.java

示例5: getWhiteList

@RemoteMethod(description = "Get the whitelist", impact = ModelMBeanOperationInfo.ACTION)
public ArrayList<UUID> getWhiteList()
{
    return Bukkit.getWhitelistedPlayers().stream().map(OfflinePlayer::getUniqueId).collect(Collectors.toCollection(ArrayList::new));
}
 
开发者ID:SamaGames,项目名称:SamaGamesCore,代码行数:5,代码来源:WhitelistFunction.java

示例6: setWhiteListActived

@RemoteMethod(description = "Set if the whitelist is actived", impact = ModelMBeanOperationInfo.ACTION)
public void setWhiteListActived(boolean actived)
{
    Bukkit.setWhitelist(actived);
}
 
开发者ID:SamaGames,项目名称:SamaGamesCore,代码行数:5,代码来源:WhitelistFunction.java

示例7: stop

@RemoteMethod(description = "Shutdown a server", impact = ModelMBeanOperationInfo.ACTION)
public void stop()
{
    Bukkit.getServer().shutdown();
}
 
开发者ID:SamaGames,项目名称:SamaGamesCore,代码行数:5,代码来源:StopFunction.java


注:本文中的javax.management.modelmbean.ModelMBeanOperationInfo.ACTION属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。