http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMBean.java deleted file mode 100644 index 3bf3971..0000000 --- a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMBean.java +++ /dev/null @@ -1,386 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.mxbean; - -import javax.management.*; -import java.util.*; - -/** - * This interface defines JMX view on kernal. - */ -@IgniteMBeanDescription("MBean that provides access to Kernal information.") -public interface IgniteMBean { - /** - * Gets file path of the license. - * - * @return File path of the license. - */ - @IgniteMBeanDescription("File path of the license.") - public String getLicenseFilePath(); - - /** - * Gets string presentation of the version. - * - * @return String presentation of the version. - */ - @IgniteMBeanDescription("String presentation of the Ignite version.") - public String getFullVersion(); - - /** - * Gets copyright statement for GridGain product. - * - * @return Copyright statement for GridGain product. - */ - @IgniteMBeanDescription("Copyright statement for GridGain product.") - public String getCopyright(); - - /** - * Gets string presentation of the kernal start timestamp. - * - * @return String presentation of the kernal start timestamp. - */ - @IgniteMBeanDescription("String presentation of the kernal start timestamp.") - public String getStartTimestampFormatted(); - - /** - * Gets string presentation of up-time for the kernal. - * - * @return String presentation of up-time for the kernal. - */ - @IgniteMBeanDescription("String presentation of up-time for the kernal.") - public String getUpTimeFormatted(); - - /** - * Get start timestamp of the kernal. - * - * @return Start timestamp of the kernal. - */ - @IgniteMBeanDescription("Start timestamp of the kernal.") - public long getStartTimestamp(); - - /** - * Gets up-time of the kernal. - * - * @return Up-time of the kernal. - */ - @IgniteMBeanDescription("Up-time of the kernal.") - public long getUpTime(); - - /** - * Gets a collection of formatted user-defined attributes added to this node. - * <p> - * Note that grid will add all System properties and environment properties - * to grid node attributes also. SPIs may also add node attributes that are - * used for SPI implementation. - * - * @return User defined attributes for this node. - */ - @IgniteMBeanDescription("Collection of formatted user-defined attributes added to this node.") - public Collection<String> getUserAttributesFormatted(); - - /** - * Gets a formatted instance of logger that is in grid. - * - * @return Logger that is used in grid. - */ - @IgniteMBeanDescription("Formatted instance of logger that is in grid.") - public String getGridLoggerFormatted(); - - /** - * Gets a formatted instance of fully configured thread pool that is used in grid. - * - * @return Thread pool implementation that is used in grid. - */ - @IgniteMBeanDescription("Formatted instance of fully configured thread pool that is used in grid.") - public String getExecutorServiceFormatted(); - - /** - * Gets GridGain installation home folder. - * - * @return GridGain installation home. - */ - @IgniteMBeanDescription("GridGain installation home folder.") - public String getGridGainHome(); - - /** - * Gets a formatted instance of MBean server instance. - * - * @return MBean server instance. - */ - @IgniteMBeanDescription("Formatted instance of MBean server instance.") - public String getMBeanServerFormatted(); - - /** - * Unique identifier for this node within grid. - * - * @return Unique identifier for this node within grid. - */ - @IgniteMBeanDescription("Unique identifier for this node within grid.") - public UUID getLocalNodeId(); - - /** - * Returns {@code true} if peer class loading is enabled, {@code false} - * otherwise. Default value is {@code true}. - * <p> - * When peer class loading is enabled and task is not deployed on local node, - * local node will try to load classes from the node that initiated task - * execution. This way, a task can be physically deployed only on one node - * and then internally penetrate to all other nodes. - * - * @return {@code true} if peer class loading is enabled, {@code false} - * otherwise. - */ - @IgniteMBeanDescription("Whether or not peer class loading (a.k.a. P2P class loading) is enabled.") - public boolean isPeerClassLoadingEnabled(); - - /** - * Gets {@code toString()} representation of of lifecycle beans configured - * with GridGain. - * - * @return {@code toString()} representation of all lifecycle beans configured - * with GridGain. - */ - @IgniteMBeanDescription("String representation of lifecycle beans.") - public Collection<String> getLifecycleBeansFormatted(); - - /** - * This method allows manually remove the checkpoint with given {@code key}. - * - * @param key Checkpoint key. - * @return {@code true} if specified checkpoint was indeed removed, {@code false} - * otherwise. - */ - @IgniteMBeanDescription("This method allows manually remove the checkpoint with given key. Return true " + - "if specified checkpoint was indeed removed, false otherwise.") - @IgniteMBeanParametersNames( - "key" - ) - @IgniteMBeanParametersDescriptions( - "Checkpoint key to remove." - ) - public boolean removeCheckpoint(String key); - - /** - * Pings node with given node ID to see whether it is alive. - * - * @param nodeId String presentation of node ID. See {@link UUID#fromString(String)} for - * details on string formatting. - * @return Whether or not node is alive. - */ - @IgniteMBeanDescription("Pings node with given node ID to see whether it is alive. " + - "Returns whether or not node is alive.") - @IgniteMBeanParametersNames( - "nodeId" - ) - @IgniteMBeanParametersDescriptions( - "String presentation of node ID. See java.util.UUID class for details." - ) - public boolean pingNode(String nodeId); - - /** - * Makes the best attempt to undeploy a task from the whole grid. Note that this - * method returns immediately and does not wait until the task will actually be - * undeployed on every node. - * <p> - * Note that GridGain maintains internal versions for grid tasks in case of redeployment. - * This method will attempt to undeploy all versions on the grid task with - * given name. - * - * @param taskName Name of the task to undeploy. If task class has {@link org.apache.ignite.compute.ComputeTaskName} annotation, - * then task was deployed under a name specified within annotation. Otherwise, full - * class name should be used as task's name. - * @throws JMException Thrown if undeploy failed. - */ - @IgniteMBeanDescription("Makes the best attempt to undeploy a task from the whole grid.") - @IgniteMBeanParametersNames( - "taskName" - ) - @IgniteMBeanParametersDescriptions( - "Name of the task to undeploy." - ) - public void undeployTaskFromGrid(String taskName) throws JMException; - - /** - * A shortcut method that executes given task assuming single {@code java.lang.String} argument - * and {@code java.lang.String} return type. - * - * @param taskName Name of the task to execute. - * @param arg Single task execution argument (can be {@code null}). - * @return Task return value (assumed of {@code java.lang.String} type). - * @throws JMException Thrown in case when execution failed. - */ - @IgniteMBeanDescription("A shortcut method that executes given task assuming single " + - "String argument and String return type. Returns Task return value (assumed of String type).") - @IgniteMBeanParametersNames( - { - "taskName", - "arg" - } - ) - @IgniteMBeanParametersDescriptions( - { - "Name of the task to execute.", - "Single task execution argument (can be null)." - } - ) - public String executeTask(String taskName, String arg) throws JMException; - - /** - * Pings node with given host name to see if it is alive. - * - * @param host Host name or IP address of the node to ping. - * @return Whether or not node is alive. - */ - @IgniteMBeanDescription("Pings node with given host name to see if it is alive. " + - "Returns whether or not node is alive.") - @IgniteMBeanParametersNames( - "host" - ) - @IgniteMBeanParametersDescriptions( - "Host name or IP address of the node to ping." - ) - public boolean pingNodeByAddress(String host); - - /** - * Gets a formatted instance of configured discovery SPI implementation. - * - * @return Grid discovery SPI implementation. - */ - @IgniteMBeanDescription("Formatted instance of configured discovery SPI implementation.") - public String getDiscoverySpiFormatted(); - - /** - * Gets a formatted instance of fully configured SPI communication implementation. - * - * @return Grid communication SPI implementation. - */ - @IgniteMBeanDescription("Formatted instance of fully configured SPI communication implementation.") - public String getCommunicationSpiFormatted(); - - /** - * Gets a formatted instance of fully configured deployment SPI implementation. - * - * @return Grid deployment SPI implementation. - */ - @IgniteMBeanDescription("Formatted instance of fully configured deployment SPI implementation.") - public String getDeploymentSpiFormatted(); - - /** - * Gets a formatted instance of configured checkpoint SPI implementation. - * - * @return Grid checkpoint SPI implementation. - */ - @IgniteMBeanDescription("Formatted instance of configured checkpoint SPI implementation.") - public String getCheckpointSpiFormatted(); - - /** - * Gets a formatted instance of configured collision SPI implementations. - * - * @return Grid collision SPI implementations. - */ - @IgniteMBeanDescription("Formatted instance of configured collision SPI implementations.") - public String getCollisionSpiFormatted(); - - /** - * Gets a formatted instance of configured swapspace SPI implementations. - * - * @return Grid swapspace SPI implementations. - */ - @IgniteMBeanDescription("Formatted instance of configured swapspace SPI implementations.") - public String getSwapSpaceSpiFormatted(); - - /** - * Gets a formatted instance of fully configured event SPI implementation. - * - * @return Grid event SPI implementation. - */ - @IgniteMBeanDescription("Formatted instance of fully configured event SPI implementation.") - public String getEventStorageSpiFormatted(); - - /** - * Gets a formatted instance of fully configured failover SPI implementations. - * - * @return Grid failover SPI implementations. - */ - @IgniteMBeanDescription("Formatted instance of fully configured failover SPI implementations.") - public String getFailoverSpiFormatted(); - - /** - * Gets a formatted instance of fully configured load balancing SPI implementations. - * - * @return Grid load balancing SPI implementations. - */ - @IgniteMBeanDescription("Formatted instance of fully configured load balancing SPI implementations.") - public String getLoadBalancingSpiFormatted(); - - /** - * Gets a formatted instance of fully configured authentication SPI implementation. - * - * @return Grid authentication SPI implementation. - */ - @IgniteMBeanDescription("Formatted instance of fully configured authentication SPI implementation.") - public String getAuthenticationSpiFormatted(); - - /** - * Gets a formatted instance of fully configured secure session SPI implementation. - * - * @return Grid secure session SPI implementation. - */ - @IgniteMBeanDescription("Formatted instance of fully configured secure session SPI implementation.") - public String getSecureSessionSpiFormatted(); - - /** - * Gets OS information. - * - * @return OS information. - */ - @IgniteMBeanDescription("OS information.") - public String getOsInformation(); - - /** - * Gets JDK information. - * - * @return JDK information. - */ - @IgniteMBeanDescription("JDK information.") - public String getJdkInformation(); - - /** - * Gets OS user. - * - * @return OS user name. - */ - @IgniteMBeanDescription("OS user name.") - public String getOsUser(); - - /** - * Gets VM name. - * - * @return VM name. - */ - @IgniteMBeanDescription("VM name.") - public String getVmName(); - - /** - * Gets optional kernal instance name. It can be {@code null}. - * - * @return Optional kernal instance name. - */ - @IgniteMBeanDescription("Optional kernal instance name.") - public String getInstanceName(); -}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMBeanDescription.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMBeanDescription.java b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMBeanDescription.java deleted file mode 100644 index f1d0e25..0000000 --- a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMBeanDescription.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.mxbean; - -import java.lang.annotation.*; - -/** - * Provides description for MBean classes and methods. - */ -@Documented -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE, ElementType.METHOD}) -public @interface IgniteMBeanDescription { - /** - * - * Description for Mbean. - */ - @SuppressWarnings({"JavaDoc"}) public String value(); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMBeanParametersDescriptions.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMBeanParametersDescriptions.java b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMBeanParametersDescriptions.java deleted file mode 100644 index e32150f..0000000 --- a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMBeanParametersDescriptions.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.mxbean; - -import java.lang.annotation.*; - -/** - * Provides MBean method parameters description. - */ -@Documented -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface IgniteMBeanParametersDescriptions { - /** - * - * Array of descriptions for parameters. - */ - @SuppressWarnings({"JavaDoc"}) public String[] value(); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMBeanParametersNames.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMBeanParametersNames.java b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMBeanParametersNames.java deleted file mode 100644 index c429f32..0000000 --- a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMBeanParametersNames.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.mxbean; - -import java.lang.annotation.*; - -/** - * Provides MBean method parameters names. - */ -@Documented -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface IgniteMBeanParametersNames { - /** - * - * Array of parameter names in MBean. - */ - @SuppressWarnings({"JavaDoc"}) public String[] value(); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java new file mode 100644 index 0000000..17a89da --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java @@ -0,0 +1,386 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.mxbean; + +import javax.management.*; +import java.util.*; + +/** + * This interface defines JMX view on kernal. + */ +@IgniteMXBeanDescription("MBean that provides access to Kernal information.") +public interface IgniteMXBean { + /** + * Gets file path of the license. + * + * @return File path of the license. + */ + @IgniteMXBeanDescription("File path of the license.") + public String getLicenseFilePath(); + + /** + * Gets string presentation of the version. + * + * @return String presentation of the version. + */ + @IgniteMXBeanDescription("String presentation of the Ignite version.") + public String getFullVersion(); + + /** + * Gets copyright statement for GridGain product. + * + * @return Copyright statement for GridGain product. + */ + @IgniteMXBeanDescription("Copyright statement for GridGain product.") + public String getCopyright(); + + /** + * Gets string presentation of the kernal start timestamp. + * + * @return String presentation of the kernal start timestamp. + */ + @IgniteMXBeanDescription("String presentation of the kernal start timestamp.") + public String getStartTimestampFormatted(); + + /** + * Gets string presentation of up-time for the kernal. + * + * @return String presentation of up-time for the kernal. + */ + @IgniteMXBeanDescription("String presentation of up-time for the kernal.") + public String getUpTimeFormatted(); + + /** + * Get start timestamp of the kernal. + * + * @return Start timestamp of the kernal. + */ + @IgniteMXBeanDescription("Start timestamp of the kernal.") + public long getStartTimestamp(); + + /** + * Gets up-time of the kernal. + * + * @return Up-time of the kernal. + */ + @IgniteMXBeanDescription("Up-time of the kernal.") + public long getUpTime(); + + /** + * Gets a collection of formatted user-defined attributes added to this node. + * <p> + * Note that grid will add all System properties and environment properties + * to grid node attributes also. SPIs may also add node attributes that are + * used for SPI implementation. + * + * @return User defined attributes for this node. + */ + @IgniteMXBeanDescription("Collection of formatted user-defined attributes added to this node.") + public Collection<String> getUserAttributesFormatted(); + + /** + * Gets a formatted instance of logger that is in grid. + * + * @return Logger that is used in grid. + */ + @IgniteMXBeanDescription("Formatted instance of logger that is in grid.") + public String getGridLoggerFormatted(); + + /** + * Gets a formatted instance of fully configured thread pool that is used in grid. + * + * @return Thread pool implementation that is used in grid. + */ + @IgniteMXBeanDescription("Formatted instance of fully configured thread pool that is used in grid.") + public String getExecutorServiceFormatted(); + + /** + * Gets GridGain installation home folder. + * + * @return GridGain installation home. + */ + @IgniteMXBeanDescription("GridGain installation home folder.") + public String getGridGainHome(); + + /** + * Gets a formatted instance of MBean server instance. + * + * @return MBean server instance. + */ + @IgniteMXBeanDescription("Formatted instance of MBean server instance.") + public String getMBeanServerFormatted(); + + /** + * Unique identifier for this node within grid. + * + * @return Unique identifier for this node within grid. + */ + @IgniteMXBeanDescription("Unique identifier for this node within grid.") + public UUID getLocalNodeId(); + + /** + * Returns {@code true} if peer class loading is enabled, {@code false} + * otherwise. Default value is {@code true}. + * <p> + * When peer class loading is enabled and task is not deployed on local node, + * local node will try to load classes from the node that initiated task + * execution. This way, a task can be physically deployed only on one node + * and then internally penetrate to all other nodes. + * + * @return {@code true} if peer class loading is enabled, {@code false} + * otherwise. + */ + @IgniteMXBeanDescription("Whether or not peer class loading (a.k.a. P2P class loading) is enabled.") + public boolean isPeerClassLoadingEnabled(); + + /** + * Gets {@code toString()} representation of of lifecycle beans configured + * with GridGain. + * + * @return {@code toString()} representation of all lifecycle beans configured + * with GridGain. + */ + @IgniteMXBeanDescription("String representation of lifecycle beans.") + public Collection<String> getLifecycleBeansFormatted(); + + /** + * This method allows manually remove the checkpoint with given {@code key}. + * + * @param key Checkpoint key. + * @return {@code true} if specified checkpoint was indeed removed, {@code false} + * otherwise. + */ + @IgniteMXBeanDescription("This method allows manually remove the checkpoint with given key. Return true " + + "if specified checkpoint was indeed removed, false otherwise.") + @IgniteMXBeanParametersNames( + "key" + ) + @IgniteMXBeanParametersDescriptions( + "Checkpoint key to remove." + ) + public boolean removeCheckpoint(String key); + + /** + * Pings node with given node ID to see whether it is alive. + * + * @param nodeId String presentation of node ID. See {@link UUID#fromString(String)} for + * details on string formatting. + * @return Whether or not node is alive. + */ + @IgniteMXBeanDescription("Pings node with given node ID to see whether it is alive. " + + "Returns whether or not node is alive.") + @IgniteMXBeanParametersNames( + "nodeId" + ) + @IgniteMXBeanParametersDescriptions( + "String presentation of node ID. See java.util.UUID class for details." + ) + public boolean pingNode(String nodeId); + + /** + * Makes the best attempt to undeploy a task from the whole grid. Note that this + * method returns immediately and does not wait until the task will actually be + * undeployed on every node. + * <p> + * Note that GridGain maintains internal versions for grid tasks in case of redeployment. + * This method will attempt to undeploy all versions on the grid task with + * given name. + * + * @param taskName Name of the task to undeploy. If task class has {@link org.apache.ignite.compute.ComputeTaskName} annotation, + * then task was deployed under a name specified within annotation. Otherwise, full + * class name should be used as task's name. + * @throws JMException Thrown if undeploy failed. + */ + @IgniteMXBeanDescription("Makes the best attempt to undeploy a task from the whole grid.") + @IgniteMXBeanParametersNames( + "taskName" + ) + @IgniteMXBeanParametersDescriptions( + "Name of the task to undeploy." + ) + public void undeployTaskFromGrid(String taskName) throws JMException; + + /** + * A shortcut method that executes given task assuming single {@code java.lang.String} argument + * and {@code java.lang.String} return type. + * + * @param taskName Name of the task to execute. + * @param arg Single task execution argument (can be {@code null}). + * @return Task return value (assumed of {@code java.lang.String} type). + * @throws JMException Thrown in case when execution failed. + */ + @IgniteMXBeanDescription("A shortcut method that executes given task assuming single " + + "String argument and String return type. Returns Task return value (assumed of String type).") + @IgniteMXBeanParametersNames( + { + "taskName", + "arg" + } + ) + @IgniteMXBeanParametersDescriptions( + { + "Name of the task to execute.", + "Single task execution argument (can be null)." + } + ) + public String executeTask(String taskName, String arg) throws JMException; + + /** + * Pings node with given host name to see if it is alive. + * + * @param host Host name or IP address of the node to ping. + * @return Whether or not node is alive. + */ + @IgniteMXBeanDescription("Pings node with given host name to see if it is alive. " + + "Returns whether or not node is alive.") + @IgniteMXBeanParametersNames( + "host" + ) + @IgniteMXBeanParametersDescriptions( + "Host name or IP address of the node to ping." + ) + public boolean pingNodeByAddress(String host); + + /** + * Gets a formatted instance of configured discovery SPI implementation. + * + * @return Grid discovery SPI implementation. + */ + @IgniteMXBeanDescription("Formatted instance of configured discovery SPI implementation.") + public String getDiscoverySpiFormatted(); + + /** + * Gets a formatted instance of fully configured SPI communication implementation. + * + * @return Grid communication SPI implementation. + */ + @IgniteMXBeanDescription("Formatted instance of fully configured SPI communication implementation.") + public String getCommunicationSpiFormatted(); + + /** + * Gets a formatted instance of fully configured deployment SPI implementation. + * + * @return Grid deployment SPI implementation. + */ + @IgniteMXBeanDescription("Formatted instance of fully configured deployment SPI implementation.") + public String getDeploymentSpiFormatted(); + + /** + * Gets a formatted instance of configured checkpoint SPI implementation. + * + * @return Grid checkpoint SPI implementation. + */ + @IgniteMXBeanDescription("Formatted instance of configured checkpoint SPI implementation.") + public String getCheckpointSpiFormatted(); + + /** + * Gets a formatted instance of configured collision SPI implementations. + * + * @return Grid collision SPI implementations. + */ + @IgniteMXBeanDescription("Formatted instance of configured collision SPI implementations.") + public String getCollisionSpiFormatted(); + + /** + * Gets a formatted instance of configured swapspace SPI implementations. + * + * @return Grid swapspace SPI implementations. + */ + @IgniteMXBeanDescription("Formatted instance of configured swapspace SPI implementations.") + public String getSwapSpaceSpiFormatted(); + + /** + * Gets a formatted instance of fully configured event SPI implementation. + * + * @return Grid event SPI implementation. + */ + @IgniteMXBeanDescription("Formatted instance of fully configured event SPI implementation.") + public String getEventStorageSpiFormatted(); + + /** + * Gets a formatted instance of fully configured failover SPI implementations. + * + * @return Grid failover SPI implementations. + */ + @IgniteMXBeanDescription("Formatted instance of fully configured failover SPI implementations.") + public String getFailoverSpiFormatted(); + + /** + * Gets a formatted instance of fully configured load balancing SPI implementations. + * + * @return Grid load balancing SPI implementations. + */ + @IgniteMXBeanDescription("Formatted instance of fully configured load balancing SPI implementations.") + public String getLoadBalancingSpiFormatted(); + + /** + * Gets a formatted instance of fully configured authentication SPI implementation. + * + * @return Grid authentication SPI implementation. + */ + @IgniteMXBeanDescription("Formatted instance of fully configured authentication SPI implementation.") + public String getAuthenticationSpiFormatted(); + + /** + * Gets a formatted instance of fully configured secure session SPI implementation. + * + * @return Grid secure session SPI implementation. + */ + @IgniteMXBeanDescription("Formatted instance of fully configured secure session SPI implementation.") + public String getSecureSessionSpiFormatted(); + + /** + * Gets OS information. + * + * @return OS information. + */ + @IgniteMXBeanDescription("OS information.") + public String getOsInformation(); + + /** + * Gets JDK information. + * + * @return JDK information. + */ + @IgniteMXBeanDescription("JDK information.") + public String getJdkInformation(); + + /** + * Gets OS user. + * + * @return OS user name. + */ + @IgniteMXBeanDescription("OS user name.") + public String getOsUser(); + + /** + * Gets VM name. + * + * @return VM name. + */ + @IgniteMXBeanDescription("VM name.") + public String getVmName(); + + /** + * Gets optional kernal instance name. It can be {@code null}. + * + * @return Optional kernal instance name. + */ + @IgniteMXBeanDescription("Optional kernal instance name.") + public String getInstanceName(); +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBeanDescription.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBeanDescription.java b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBeanDescription.java new file mode 100644 index 0000000..71fc95b --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBeanDescription.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.mxbean; + +import java.lang.annotation.*; + +/** + * Provides description for MBean classes and methods. + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE, ElementType.METHOD}) +public @interface IgniteMXBeanDescription { + /** + * + * Description for Mbean. + */ + @SuppressWarnings({"JavaDoc"}) public String value(); +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBeanParametersDescriptions.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBeanParametersDescriptions.java b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBeanParametersDescriptions.java new file mode 100644 index 0000000..cd5a9e2 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBeanParametersDescriptions.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.mxbean; + +import java.lang.annotation.*; + +/** + * Provides MBean method parameters description. + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD}) +public @interface IgniteMXBeanParametersDescriptions { + /** + * + * Array of descriptions for parameters. + */ + @SuppressWarnings({"JavaDoc"}) public String[] value(); +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBeanParametersNames.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBeanParametersNames.java b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBeanParametersNames.java new file mode 100644 index 0000000..f4b18ad --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBeanParametersNames.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.mxbean; + +import java.lang.annotation.*; + +/** + * Provides MBean method parameters names. + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD}) +public @interface IgniteMXBeanParametersNames { + /** + * + * Array of parameter names in MBean. + */ + @SuppressWarnings({"JavaDoc"}) public String[] value(); +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteThreadPoolMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteThreadPoolMBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteThreadPoolMBean.java deleted file mode 100644 index 3746527..0000000 --- a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteThreadPoolMBean.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.mxbean; - -/** - * MBean that provides access to information about executor service. - */ -@IgniteMBeanDescription("MBean that provides access to information about executor service.") -public interface IgniteThreadPoolMBean { - /** - * Returns the approximate number of threads that are actively executing tasks. - * - * @return The number of threads. - */ - @IgniteMBeanDescription("Approximate number of threads that are actively executing tasks.") - public int getActiveCount(); - - /** - * Returns the approximate total number of tasks that have completed execution. - * Because the states of tasks and threads may change dynamically during - * computation, the returned value is only an approximation, but one that - * does not ever decrease across successive calls. - * - * @return The number of tasks. - */ - @IgniteMBeanDescription("Approximate total number of tasks that have completed execution.") - public long getCompletedTaskCount(); - - /** - * Returns the core number of threads. - * - * @return The core number of threads. - */ - @IgniteMBeanDescription("The core number of threads.") - public int getCorePoolSize(); - - /** - * Returns the largest number of threads that have ever - * simultaneously been in the pool. - * - * @return The number of threads. - */ - @IgniteMBeanDescription("Largest number of threads that have ever simultaneously been in the pool.") - public int getLargestPoolSize(); - - /** - * Returns the maximum allowed number of threads. - * - * @return The maximum allowed number of threads. - */ - @IgniteMBeanDescription("The maximum allowed number of threads.") - public int getMaximumPoolSize(); - - /** - * Returns the current number of threads in the pool. - * - * @return The number of threads. - */ - @IgniteMBeanDescription("Current number of threads in the pool.") - public int getPoolSize(); - - /** - * Returns the approximate total number of tasks that have been scheduled - * for execution. Because the states of tasks and threads may change dynamically - * during computation, the returned value is only an approximation, but - * one that does not ever decrease across successive calls. - * - * @return The number of tasks. - */ - @IgniteMBeanDescription("Approximate total number of tasks that have been scheduled for execution.") - public long getTaskCount(); - - /** - * Gets current size of the execution queue. This queue buffers local - * executions when there are not threads available for processing in the pool. - * - * @return Current size of the execution queue. - */ - @IgniteMBeanDescription("Current size of the execution queue.") - public int getQueueSize(); - - /** - * Returns the thread keep-alive time, which is the amount of time which threads - * in excess of the core pool size may remain idle before being terminated. - * - * @return Keep alive time. - */ - @IgniteMBeanDescription("Thread keep-alive time, which is the amount of time which threads in excess of " + - "the core pool size may remain idle before being terminated.") - public long getKeepAliveTime(); - - /** - * Returns {@code true} if this executor has been shut down. - * - * @return {@code True} if this executor has been shut down. - */ - @IgniteMBeanDescription("True if this executor has been shut down.") - public boolean isShutdown(); - - /** - * Returns {@code true} if all tasks have completed following shut down. Note that - * {@code isTerminated()} is never {@code true} unless either {@code shutdown()} or - * {@code shutdownNow()} was called first. - * - * @return {@code True} if all tasks have completed following shut down. - */ - @IgniteMBeanDescription("True if all tasks have completed following shut down.") - public boolean isTerminated(); - - /** - * Returns {@code true} if this executor is in the process of terminating after - * {@code shutdown()} or {@code shutdownNow()} but has not completely terminated. - * This method may be useful for debugging. A return of {@code true} reported a - * sufficient period after shutdown may indicate that submitted tasks have ignored - * or suppressed interruption, causing this executor not to properly terminate. - * - * @return {@code True} if terminating but not yet terminated. - */ - @IgniteMBeanDescription("True if terminating but not yet terminated.") - public boolean isTerminating(); - - /** - * Returns the class name of current rejection handler. - * - * @return Class name of current rejection handler. - */ - @IgniteMBeanDescription("Class name of current rejection handler.") - public String getRejectedExecutionHandlerClass(); - - /** - * Returns the class name of thread factory used to create new threads. - * - * @return Class name of thread factory used to create new threads. - */ - @IgniteMBeanDescription("Class name of thread factory used to create new threads.") - public String getThreadFactoryClass(); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteThreadPoolMXBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteThreadPoolMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteThreadPoolMXBean.java new file mode 100644 index 0000000..29fa2cf --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteThreadPoolMXBean.java @@ -0,0 +1,152 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.mxbean; + +/** + * MBean that provides access to information about executor service. + */ +@IgniteMXBeanDescription("MBean that provides access to information about executor service.") +public interface IgniteThreadPoolMXBean { + /** + * Returns the approximate number of threads that are actively executing tasks. + * + * @return The number of threads. + */ + @IgniteMXBeanDescription("Approximate number of threads that are actively executing tasks.") + public int getActiveCount(); + + /** + * Returns the approximate total number of tasks that have completed execution. + * Because the states of tasks and threads may change dynamically during + * computation, the returned value is only an approximation, but one that + * does not ever decrease across successive calls. + * + * @return The number of tasks. + */ + @IgniteMXBeanDescription("Approximate total number of tasks that have completed execution.") + public long getCompletedTaskCount(); + + /** + * Returns the core number of threads. + * + * @return The core number of threads. + */ + @IgniteMXBeanDescription("The core number of threads.") + public int getCorePoolSize(); + + /** + * Returns the largest number of threads that have ever + * simultaneously been in the pool. + * + * @return The number of threads. + */ + @IgniteMXBeanDescription("Largest number of threads that have ever simultaneously been in the pool.") + public int getLargestPoolSize(); + + /** + * Returns the maximum allowed number of threads. + * + * @return The maximum allowed number of threads. + */ + @IgniteMXBeanDescription("The maximum allowed number of threads.") + public int getMaximumPoolSize(); + + /** + * Returns the current number of threads in the pool. + * + * @return The number of threads. + */ + @IgniteMXBeanDescription("Current number of threads in the pool.") + public int getPoolSize(); + + /** + * Returns the approximate total number of tasks that have been scheduled + * for execution. Because the states of tasks and threads may change dynamically + * during computation, the returned value is only an approximation, but + * one that does not ever decrease across successive calls. + * + * @return The number of tasks. + */ + @IgniteMXBeanDescription("Approximate total number of tasks that have been scheduled for execution.") + public long getTaskCount(); + + /** + * Gets current size of the execution queue. This queue buffers local + * executions when there are not threads available for processing in the pool. + * + * @return Current size of the execution queue. + */ + @IgniteMXBeanDescription("Current size of the execution queue.") + public int getQueueSize(); + + /** + * Returns the thread keep-alive time, which is the amount of time which threads + * in excess of the core pool size may remain idle before being terminated. + * + * @return Keep alive time. + */ + @IgniteMXBeanDescription("Thread keep-alive time, which is the amount of time which threads in excess of " + + "the core pool size may remain idle before being terminated.") + public long getKeepAliveTime(); + + /** + * Returns {@code true} if this executor has been shut down. + * + * @return {@code True} if this executor has been shut down. + */ + @IgniteMXBeanDescription("True if this executor has been shut down.") + public boolean isShutdown(); + + /** + * Returns {@code true} if all tasks have completed following shut down. Note that + * {@code isTerminated()} is never {@code true} unless either {@code shutdown()} or + * {@code shutdownNow()} was called first. + * + * @return {@code True} if all tasks have completed following shut down. + */ + @IgniteMXBeanDescription("True if all tasks have completed following shut down.") + public boolean isTerminated(); + + /** + * Returns {@code true} if this executor is in the process of terminating after + * {@code shutdown()} or {@code shutdownNow()} but has not completely terminated. + * This method may be useful for debugging. A return of {@code true} reported a + * sufficient period after shutdown may indicate that submitted tasks have ignored + * or suppressed interruption, causing this executor not to properly terminate. + * + * @return {@code True} if terminating but not yet terminated. + */ + @IgniteMXBeanDescription("True if terminating but not yet terminated.") + public boolean isTerminating(); + + /** + * Returns the class name of current rejection handler. + * + * @return Class name of current rejection handler. + */ + @IgniteMXBeanDescription("Class name of current rejection handler.") + public String getRejectedExecutionHandlerClass(); + + /** + * Returns the class name of thread factory used to create new threads. + * + * @return Class name of thread factory used to create new threads. + */ + @IgniteMXBeanDescription("Class name of thread factory used to create new threads.") + public String getThreadFactoryClass(); +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/mxbean/IgnitionMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/IgnitionMBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/IgnitionMBean.java deleted file mode 100644 index adc90e9..0000000 --- a/modules/core/src/main/java/org/apache/ignite/mxbean/IgnitionMBean.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.mxbean; - -/** - * This interface defines JMX view on {@link org.apache.ignite.Ignition}. - */ -@IgniteMBeanDescription("MBean that provides access to grid life-cycle operations.") -public interface IgnitionMBean { - /** - * Gets state of default grid instance. - * - * @return State of default grid instance. - * @see org.apache.ignite.Ignition#state() - */ - @IgniteMBeanDescription("State of default grid instance.") - public String getState(); - - /** - * Gets state for a given grid instance. - * - * @param name Name of grid instance. - * @return State of grid instance with given name. - * @see org.apache.ignite.Ignition#state(String) - */ - @IgniteMBeanDescription("Gets state for a given grid instance. Returns state of grid instance with given name.") - @IgniteMBeanParametersNames( - "name" - ) - @IgniteMBeanParametersDescriptions( - "Name of grid instance." - ) - public String getState(String name); - - /** - * Stops default grid instance. - * - * @param cancel If {@code true} then all jobs currently executing on - * default grid will be cancelled by calling {@link org.apache.ignite.compute.ComputeJob#cancel()} - * method. Note that just like with {@link Thread#interrupt()}, it is - * up to the actual job to exit from execution. - * @return {@code true} if default grid instance was indeed stopped, - * {@code false} otherwise (if it was not started). - * @see org.apache.ignite.Ignition#stop(boolean) - */ - @IgniteMBeanDescription("Stops default grid instance. Return true if default grid instance was " + - "indeed stopped, false otherwise (if it was not started).") - @IgniteMBeanParametersNames( - "cancel" - ) - @IgniteMBeanParametersDescriptions( - "If true then all jobs currently executing on default grid will be cancelled." - ) - public boolean stop(boolean cancel); - - /** - * Stops named grid. If {@code cancel} flag is set to {@code true} then - * all jobs currently executing on local node will be interrupted. If - * grid name is {@code null}, then default no-name grid will be stopped. - * It does not wait for the tasks to finish their execution. - * - * @param name Grid name. If {@code null}, then default no-name grid will - * be stopped. - * @param cancel If {@code true} then all jobs currently will be cancelled - * by calling {@link org.apache.ignite.compute.ComputeJob#cancel()} method. Note that just like with - * {@link Thread#interrupt()}, it is up to the actual job to exit from - * execution. If {@code false}, then jobs currently running will not be - * canceled. In either case, grid node will wait for completion of all - * jobs running on it before stopping. - * @return {@code true} if named grid instance was indeed found and stopped, - * {@code false} otherwise (the instance with given {@code name} was - * not found). - * @see org.apache.ignite.Ignition#stop(String, boolean) - */ - @IgniteMBeanDescription("Stops grid by name. Cancels running jobs if cancel is true. Returns true if named " + - "grid instance was indeed found and stopped, false otherwise.") - @IgniteMBeanParametersNames( - { - "name", - "cancel" - }) - @IgniteMBeanParametersDescriptions( - { - "Grid instance name to stop.", - "Whether or not running jobs should be cancelled." - } - ) - public boolean stop(String name, boolean cancel); - - /** - * Stops <b>all</b> started grids. If {@code cancel} flag is set to {@code true} then - * all jobs currently executing on local node will be interrupted. - * It does not wait for the tasks to finish their execution. - * <p> - * <b>Note:</b> it is usually safer and more appropriate to stop grid instances individually - * instead of blanket operation. In most cases, the party that started the grid instance - * should be responsible for stopping it. - * - * @param cancel If {@code true} then all jobs currently executing on - * all grids will be cancelled by calling {@link org.apache.ignite.compute.ComputeJob#cancel()} - * method. Note that just like with {@link Thread#interrupt()}, it is - * up to the actual job to exit from execution - * @see org.apache.ignite.Ignition#stopAll(boolean) - */ - @IgniteMBeanDescription("Stops all started grids.") - @IgniteMBeanParametersNames( - "cancel" - ) - @IgniteMBeanParametersDescriptions( - "If true then all jobs currently executing on all grids will be cancelled." - ) - public void stopAll(boolean cancel); - - /** - * Restart JVM. - * - * @param cancel If {@code true} then all jobs currently executing on - * all grids will be cancelled by calling {@link org.apache.ignite.compute.ComputeJob#cancel()} - * method. Note that just like with {@link Thread#interrupt()}, it is - * up to the actual job to exit from execution - * @see org.apache.ignite.Ignition#stopAll(boolean) - */ - @IgniteMBeanDescription("Restart JVM.") - @IgniteMBeanParametersNames( - { - "cancel", - "wait" - }) - @IgniteMBeanParametersDescriptions( - { - "If true then all jobs currently executing on default grid will be cancelled.", - "If true then method will wait for all task being executed until they finish their execution." - } - ) - public void restart(boolean cancel); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/mxbean/IgnitionMXBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/IgnitionMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/IgnitionMXBean.java new file mode 100644 index 0000000..21fad4c --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/mxbean/IgnitionMXBean.java @@ -0,0 +1,151 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.mxbean; + +/** + * This interface defines JMX view on {@link org.apache.ignite.Ignition}. + */ +@IgniteMXBeanDescription("MBean that provides access to grid life-cycle operations.") +public interface IgnitionMXBean { + /** + * Gets state of default grid instance. + * + * @return State of default grid instance. + * @see org.apache.ignite.Ignition#state() + */ + @IgniteMXBeanDescription("State of default grid instance.") + public String getState(); + + /** + * Gets state for a given grid instance. + * + * @param name Name of grid instance. + * @return State of grid instance with given name. + * @see org.apache.ignite.Ignition#state(String) + */ + @IgniteMXBeanDescription("Gets state for a given grid instance. Returns state of grid instance with given name.") + @IgniteMXBeanParametersNames( + "name" + ) + @IgniteMXBeanParametersDescriptions( + "Name of grid instance." + ) + public String getState(String name); + + /** + * Stops default grid instance. + * + * @param cancel If {@code true} then all jobs currently executing on + * default grid will be cancelled by calling {@link org.apache.ignite.compute.ComputeJob#cancel()} + * method. Note that just like with {@link Thread#interrupt()}, it is + * up to the actual job to exit from execution. + * @return {@code true} if default grid instance was indeed stopped, + * {@code false} otherwise (if it was not started). + * @see org.apache.ignite.Ignition#stop(boolean) + */ + @IgniteMXBeanDescription("Stops default grid instance. Return true if default grid instance was " + + "indeed stopped, false otherwise (if it was not started).") + @IgniteMXBeanParametersNames( + "cancel" + ) + @IgniteMXBeanParametersDescriptions( + "If true then all jobs currently executing on default grid will be cancelled." + ) + public boolean stop(boolean cancel); + + /** + * Stops named grid. If {@code cancel} flag is set to {@code true} then + * all jobs currently executing on local node will be interrupted. If + * grid name is {@code null}, then default no-name grid will be stopped. + * It does not wait for the tasks to finish their execution. + * + * @param name Grid name. If {@code null}, then default no-name grid will + * be stopped. + * @param cancel If {@code true} then all jobs currently will be cancelled + * by calling {@link org.apache.ignite.compute.ComputeJob#cancel()} method. Note that just like with + * {@link Thread#interrupt()}, it is up to the actual job to exit from + * execution. If {@code false}, then jobs currently running will not be + * canceled. In either case, grid node will wait for completion of all + * jobs running on it before stopping. + * @return {@code true} if named grid instance was indeed found and stopped, + * {@code false} otherwise (the instance with given {@code name} was + * not found). + * @see org.apache.ignite.Ignition#stop(String, boolean) + */ + @IgniteMXBeanDescription("Stops grid by name. Cancels running jobs if cancel is true. Returns true if named " + + "grid instance was indeed found and stopped, false otherwise.") + @IgniteMXBeanParametersNames( + { + "name", + "cancel" + }) + @IgniteMXBeanParametersDescriptions( + { + "Grid instance name to stop.", + "Whether or not running jobs should be cancelled." + } + ) + public boolean stop(String name, boolean cancel); + + /** + * Stops <b>all</b> started grids. If {@code cancel} flag is set to {@code true} then + * all jobs currently executing on local node will be interrupted. + * It does not wait for the tasks to finish their execution. + * <p> + * <b>Note:</b> it is usually safer and more appropriate to stop grid instances individually + * instead of blanket operation. In most cases, the party that started the grid instance + * should be responsible for stopping it. + * + * @param cancel If {@code true} then all jobs currently executing on + * all grids will be cancelled by calling {@link org.apache.ignite.compute.ComputeJob#cancel()} + * method. Note that just like with {@link Thread#interrupt()}, it is + * up to the actual job to exit from execution + * @see org.apache.ignite.Ignition#stopAll(boolean) + */ + @IgniteMXBeanDescription("Stops all started grids.") + @IgniteMXBeanParametersNames( + "cancel" + ) + @IgniteMXBeanParametersDescriptions( + "If true then all jobs currently executing on all grids will be cancelled." + ) + public void stopAll(boolean cancel); + + /** + * Restart JVM. + * + * @param cancel If {@code true} then all jobs currently executing on + * all grids will be cancelled by calling {@link org.apache.ignite.compute.ComputeJob#cancel()} + * method. Note that just like with {@link Thread#interrupt()}, it is + * up to the actual job to exit from execution + * @see org.apache.ignite.Ignition#stopAll(boolean) + */ + @IgniteMXBeanDescription("Restart JVM.") + @IgniteMXBeanParametersNames( + { + "cancel", + "wait" + }) + @IgniteMXBeanParametersDescriptions( + { + "If true then all jobs currently executing on default grid will be cancelled.", + "If true then method will wait for all task being executed until they finish their execution." + } + ) + public void restart(boolean cancel); +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiManagementMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiManagementMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiManagementMBean.java index e8c0111..ec16cf9 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiManagementMBean.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiManagementMBean.java @@ -32,7 +32,7 @@ public interface IgniteSpiManagementMBean { * * @return String presentation of the start timestamp. */ - @IgniteMBeanDescription("String presentation of the start timestamp.") + @IgniteMXBeanDescription("String presentation of the start timestamp.") public String getStartTimestampFormatted(); /** @@ -40,7 +40,7 @@ public interface IgniteSpiManagementMBean { * * @return String presentation of up-time for this SPI. */ - @IgniteMBeanDescription("String presentation of up-time for this SPI.") + @IgniteMXBeanDescription("String presentation of up-time for this SPI.") public String getUpTimeFormatted(); /** @@ -48,7 +48,7 @@ public interface IgniteSpiManagementMBean { * * @return Start timestamp of this SPI. */ - @IgniteMBeanDescription("Start timestamp of this SPI.") + @IgniteMXBeanDescription("Start timestamp of this SPI.") public long getStartTimestamp(); /** @@ -56,7 +56,7 @@ public interface IgniteSpiManagementMBean { * * @return Up-time of this SPI. */ - @IgniteMBeanDescription("Up-time of this SPI in milliseconds.") + @IgniteMXBeanDescription("Up-time of this SPI in milliseconds.") public long getUpTime(); /** @@ -64,7 +64,7 @@ public interface IgniteSpiManagementMBean { * * @return Gridgain installation home folder. */ - @IgniteMBeanDescription("Gridgain installation home folder.") + @IgniteMXBeanDescription("Gridgain installation home folder.") public String getGridGainHome(); /** @@ -72,7 +72,7 @@ public interface IgniteSpiManagementMBean { * * @return ID of the local node. */ - @IgniteMBeanDescription("ID of the local node.") + @IgniteMXBeanDescription("ID of the local node.") public UUID getLocalNodeId(); /** @@ -80,6 +80,6 @@ public interface IgniteSpiManagementMBean { * * @return Name of the SPI. */ - @IgniteMBeanDescription("Name of the SPI.") + @IgniteMXBeanDescription("Name of the SPI.") public String getName(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/spi/authentication/noop/NoopAuthenticationSpiMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/authentication/noop/NoopAuthenticationSpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/authentication/noop/NoopAuthenticationSpiMBean.java index e4c9b84..c0e54e9 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/authentication/noop/NoopAuthenticationSpiMBean.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/authentication/noop/NoopAuthenticationSpiMBean.java @@ -23,7 +23,7 @@ import org.apache.ignite.spi.*; /** * Management bean for {@link NoopAuthenticationSpi}. */ -@IgniteMBeanDescription("MBean that provides access to no-op authentication SPI configuration.") +@IgniteMXBeanDescription("MBean that provides access to no-op authentication SPI configuration.") public interface NoopAuthenticationSpiMBean extends IgniteSpiManagementMBean { // No-op. } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/cache/CacheCheckpointSpiMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/cache/CacheCheckpointSpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/cache/CacheCheckpointSpiMBean.java index 4d08a95..7ff7118 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/cache/CacheCheckpointSpiMBean.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/cache/CacheCheckpointSpiMBean.java @@ -26,13 +26,13 @@ import org.apache.ignite.spi.*; * * */ -@IgniteMBeanDescription("MBean provides information about cache checkpoint SPI.") +@IgniteMXBeanDescription("MBean provides information about cache checkpoint SPI.") public interface CacheCheckpointSpiMBean extends IgniteSpiManagementMBean { /** * Gets cache name to be used by this SPI.. * * @return Cache name to be used by this SPI. */ - @IgniteMBeanDescription("Cache name to be used by this SPI.") + @IgniteMXBeanDescription("Cache name to be used by this SPI.") public String getCacheName(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/jdbc/JdbcCheckpointSpiMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/jdbc/JdbcCheckpointSpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/jdbc/JdbcCheckpointSpiMBean.java index b31e331..930cde5 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/jdbc/JdbcCheckpointSpiMBean.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/jdbc/JdbcCheckpointSpiMBean.java @@ -25,14 +25,14 @@ import org.apache.ignite.spi.*; * Management bean that provides general administrative and configuration information * about jdbc checkpoint SPI. */ -@IgniteMBeanDescription("MBean that provides information about jdbc checkpoint SPI.") +@IgniteMXBeanDescription("MBean that provides information about jdbc checkpoint SPI.") public interface JdbcCheckpointSpiMBean extends IgniteSpiManagementMBean { /** * Gets number of retries in case of DB failure. * * @return Number of retries. */ - @IgniteMBeanDescription("Number of retries.") + @IgniteMXBeanDescription("Number of retries.") public int getNumberOfRetries(); /** @@ -40,7 +40,7 @@ public interface JdbcCheckpointSpiMBean extends IgniteSpiManagementMBean { * * @return Description for data source. */ - @IgniteMBeanDescription("Data source description.") + @IgniteMXBeanDescription("Data source description.") public String getDataSourceInfo(); /** @@ -48,7 +48,7 @@ public interface JdbcCheckpointSpiMBean extends IgniteSpiManagementMBean { * * @return User name for checkpoint jdbc. */ - @IgniteMBeanDescription("User name for checkpoint database.") + @IgniteMXBeanDescription("User name for checkpoint database.") public String getUser(); /** @@ -56,7 +56,7 @@ public interface JdbcCheckpointSpiMBean extends IgniteSpiManagementMBean { * * @return Password for checkpoint jdbc. */ - @IgniteMBeanDescription("Password for checkpoint database.") + @IgniteMXBeanDescription("Password for checkpoint database.") public String getPwd(); /** @@ -64,7 +64,7 @@ public interface JdbcCheckpointSpiMBean extends IgniteSpiManagementMBean { * * @return Checkpoint table name. */ - @IgniteMBeanDescription("Checkpoint table name.") + @IgniteMXBeanDescription("Checkpoint table name.") public String getCheckpointTableName(); /** @@ -72,7 +72,7 @@ public interface JdbcCheckpointSpiMBean extends IgniteSpiManagementMBean { * * @return Key field name for checkpoint table. */ - @IgniteMBeanDescription("Key field name for checkpoint table.") + @IgniteMXBeanDescription("Key field name for checkpoint table.") public String getKeyFieldName(); /** @@ -80,7 +80,7 @@ public interface JdbcCheckpointSpiMBean extends IgniteSpiManagementMBean { * * @return Key field type for checkpoint table. */ - @IgniteMBeanDescription("Key field type for checkpoint table.") + @IgniteMXBeanDescription("Key field type for checkpoint table.") public String getKeyFieldType(); /** @@ -88,7 +88,7 @@ public interface JdbcCheckpointSpiMBean extends IgniteSpiManagementMBean { * * @return Value field name for checkpoint table. */ - @IgniteMBeanDescription("Value field name for checkpoint table.") + @IgniteMXBeanDescription("Value field name for checkpoint table.") public String getValueFieldName(); /** @@ -96,7 +96,7 @@ public interface JdbcCheckpointSpiMBean extends IgniteSpiManagementMBean { * * @return Value field type for checkpoint table. */ - @IgniteMBeanDescription("Value field type for checkpoint table.") + @IgniteMXBeanDescription("Value field type for checkpoint table.") public String getValueFieldType(); /** @@ -104,7 +104,7 @@ public interface JdbcCheckpointSpiMBean extends IgniteSpiManagementMBean { * * @return Create date field name for checkpoint table. */ - @IgniteMBeanDescription("Expiration date field name for checkpoint table.") + @IgniteMXBeanDescription("Expiration date field name for checkpoint table.") public String getExpireDateFieldName(); /** @@ -112,6 +112,6 @@ public interface JdbcCheckpointSpiMBean extends IgniteSpiManagementMBean { * * @return Expiration date field type for checkpoint table. */ - @IgniteMBeanDescription("Expiration date field type for checkpoint table.") + @IgniteMXBeanDescription("Expiration date field type for checkpoint table.") public String getExpireDateFieldType(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsCheckpointSpiMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsCheckpointSpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsCheckpointSpiMBean.java index 94117a5..2ef4634 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsCheckpointSpiMBean.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/sharedfs/SharedFsCheckpointSpiMBean.java @@ -26,14 +26,14 @@ import java.util.*; * Management bean that provides general administrative and configuration information * about shared file system checkpoints. */ -@IgniteMBeanDescription("MBean for shared file system based checkpoint SPI.") +@IgniteMXBeanDescription("MBean for shared file system based checkpoint SPI.") public interface SharedFsCheckpointSpiMBean extends IgniteSpiManagementMBean { /** * Gets path to the directory where all checkpoints are saved. * * @return Path to the checkpoints directory. */ - @IgniteMBeanDescription("Gets path to the directory where all checkpoints are saved.") + @IgniteMXBeanDescription("Gets path to the directory where all checkpoints are saved.") public String getCurrentDirectoryPath(); @@ -42,6 +42,6 @@ public interface SharedFsCheckpointSpiMBean extends IgniteSpiManagementMBean { * * @return Collection of all configured paths. */ - @IgniteMBeanDescription("Gets collection of all configured paths where checkpoints can be saved.") + @IgniteMXBeanDescription("Gets collection of all configured paths where checkpoints can be saved.") public Collection<String> getDirectoryPaths(); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8b6cd806/modules/core/src/main/java/org/apache/ignite/spi/collision/fifoqueue/FifoQueueCollisionSpiMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/collision/fifoqueue/FifoQueueCollisionSpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/collision/fifoqueue/FifoQueueCollisionSpiMBean.java index 3eb281b..ccf56c0 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/collision/fifoqueue/FifoQueueCollisionSpiMBean.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/collision/fifoqueue/FifoQueueCollisionSpiMBean.java @@ -23,14 +23,14 @@ import org.apache.ignite.spi.*; /** * Management bean that provides access to the FIFO queue collision SPI configuration. */ -@IgniteMBeanDescription("MBean provides information about FIFO queue based collision SPI configuration.") +@IgniteMXBeanDescription("MBean provides information about FIFO queue based collision SPI configuration.") public interface FifoQueueCollisionSpiMBean extends IgniteSpiManagementMBean { /** * Gets number of jobs that can be executed in parallel. * * @return Number of jobs that can be executed in parallel. */ - @IgniteMBeanDescription("Number of jobs that can be executed in parallel.") + @IgniteMXBeanDescription("Number of jobs that can be executed in parallel.") public int getParallelJobsNumber(); /** @@ -38,7 +38,7 @@ public interface FifoQueueCollisionSpiMBean extends IgniteSpiManagementMBean { * * @param num Parallel jobs number. */ - @IgniteMBeanDescription("Number of jobs that can be executed in parallel.") + @IgniteMXBeanDescription("Number of jobs that can be executed in parallel.") public void setParallelJobsNumber(int num); /** @@ -47,7 +47,7 @@ public interface FifoQueueCollisionSpiMBean extends IgniteSpiManagementMBean { * * @return Maximum allowed number of waiting jobs. */ - @IgniteMBeanDescription("Maximum allowed number of waiting jobs.") + @IgniteMXBeanDescription("Maximum allowed number of waiting jobs.") public int getWaitingJobsNumber(); /** @@ -56,7 +56,7 @@ public interface FifoQueueCollisionSpiMBean extends IgniteSpiManagementMBean { * * @param num Waiting jobs number. */ - @IgniteMBeanDescription("Maximum allowed number of waiting jobs.") + @IgniteMXBeanDescription("Maximum allowed number of waiting jobs.") public void setWaitingJobsNumber(int num); /** @@ -64,7 +64,7 @@ public interface FifoQueueCollisionSpiMBean extends IgniteSpiManagementMBean { * * @return Number of jobs that wait for execution. */ - @IgniteMBeanDescription("Number of jobs that wait for execution.") + @IgniteMXBeanDescription("Number of jobs that wait for execution.") public int getCurrentWaitJobsNumber(); /** @@ -72,7 +72,7 @@ public interface FifoQueueCollisionSpiMBean extends IgniteSpiManagementMBean { * * @return Number of active jobs. */ - @IgniteMBeanDescription("Number of active jobs.") + @IgniteMXBeanDescription("Number of active jobs.") public int getCurrentActiveJobsNumber(); /* @@ -80,7 +80,7 @@ public interface FifoQueueCollisionSpiMBean extends IgniteSpiManagementMBean { * * @return Number of currently running (not {@code 'held}) jobs. */ - @IgniteMBeanDescription("Number of running jobs.") + @IgniteMXBeanDescription("Number of running jobs.") public int getCurrentRunningJobsNumber(); /** @@ -88,6 +88,6 @@ public interface FifoQueueCollisionSpiMBean extends IgniteSpiManagementMBean { * * @return Number of currently {@code 'held'} jobs. */ - @IgniteMBeanDescription("Number of held jobs.") + @IgniteMXBeanDescription("Number of held jobs.") public int getCurrentHeldJobsNumber(); }