http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/adaptive/AdaptiveLoadBalancingSpiMXBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/adaptive/AdaptiveLoadBalancingSpiMXBean.java b/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/adaptive/AdaptiveLoadBalancingSpiMXBean.java new file mode 100644 index 0000000..dfb459a --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/adaptive/AdaptiveLoadBalancingSpiMXBean.java @@ -0,0 +1,35 @@ +/* + * 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.spi.loadbalancing.adaptive; + +import org.apache.ignite.mxbean.*; +import org.apache.ignite.spi.*; + +/** + * Management MBean for {@link AdaptiveLoadBalancingSpi} SPI. + */ +@IgniteMXBeanDescription("MXBean that provides access to adaptive load balancing SPI configuration.") +public interface AdaptiveLoadBalancingSpiMXBean extends IgniteSpiManagementMXBean { + /** + * Gets text description of current load probing implementation used. + * + * @return Text description of current load probing implementation used. + */ + @IgniteMXBeanDescription("Text description of current load probing implementation used.") + public String getLoadProbeFormatted(); +}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpi.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpi.java index 28aaece..9352a62 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpi.java @@ -161,7 +161,7 @@ import static org.apache.ignite.events.IgniteEventType.*; */ @IgniteSpiMultipleInstancesSupport(true) public class RoundRobinLoadBalancingSpi extends IgniteSpiAdapter implements LoadBalancingSpi, - RoundRobinLoadBalancingSpiMBean { + RoundRobinLoadBalancingSpiMXBean { /** Grid logger. */ @IgniteLoggerResource private IgniteLogger log; @@ -224,7 +224,7 @@ public class RoundRobinLoadBalancingSpi extends IgniteSpiAdapter implements Load if (log.isDebugEnabled()) log.debug(configInfo("isPerTask", isPerTask)); - registerMBean(gridName, this, RoundRobinLoadBalancingSpiMBean.class); + registerMXBean(gridName, this, RoundRobinLoadBalancingSpiMXBean.class); balancer = new RoundRobinGlobalLoadBalancer(log); @@ -239,7 +239,7 @@ public class RoundRobinLoadBalancingSpi extends IgniteSpiAdapter implements Load perTaskBalancers.clear(); - unregisterMBean(); + unregisterMXBean(); // Ack ok stop. if (log.isDebugEnabled()) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpiMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpiMBean.java deleted file mode 100644 index 37e863f..0000000 --- a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpiMBean.java +++ /dev/null @@ -1,45 +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.spi.loadbalancing.roundrobin; - -import org.apache.ignite.mxbean.*; -import org.apache.ignite.spi.*; - -/** - * Management bean for {@link RoundRobinLoadBalancingSpi} SPI. - */ -@IgniteMXBeanDescription("MBean that provides access to round robin load balancing SPI configuration.") -public interface RoundRobinLoadBalancingSpiMBean extends IgniteSpiManagementMBean { - /** - * Configuration parameter indicating whether a new round robin order should be - * created for every task. If {@code true} then load balancer is guaranteed - * to iterate through nodes sequentially for every task - so as long as number - * of jobs is less than or equal to the number of nodes, jobs are guaranteed to - * be assigned to unique nodes. If {@code false} then one round-robin order - * will be maintained for all tasks, so when tasks execute concurrently, it - * is possible for more than one job within task to be assigned to the same - * node. - * <p> - * Default is {@code true}. - * - * @return Configuration parameter indicating whether a new round robin order should - * be created for every task. Default is {@code true}. - */ - @IgniteMXBeanDescription("Configuration parameter indicating whether a new round robin order should be created for every task.") - public boolean isPerTask(); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpiMXBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpiMXBean.java b/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpiMXBean.java new file mode 100644 index 0000000..9db8da6 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/roundrobin/RoundRobinLoadBalancingSpiMXBean.java @@ -0,0 +1,45 @@ +/* + * 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.spi.loadbalancing.roundrobin; + +import org.apache.ignite.mxbean.*; +import org.apache.ignite.spi.*; + +/** + * Management bean for {@link RoundRobinLoadBalancingSpi} SPI. + */ +@IgniteMXBeanDescription("MXBean that provides access to round robin load balancing SPI configuration.") +public interface RoundRobinLoadBalancingSpiMXBean extends IgniteSpiManagementMXBean { + /** + * Configuration parameter indicating whether a new round robin order should be + * created for every task. If {@code true} then load balancer is guaranteed + * to iterate through nodes sequentially for every task - so as long as number + * of jobs is less than or equal to the number of nodes, jobs are guaranteed to + * be assigned to unique nodes. If {@code false} then one round-robin order + * will be maintained for all tasks, so when tasks execute concurrently, it + * is possible for more than one job within task to be assigned to the same + * node. + * <p> + * Default is {@code true}. + * + * @return Configuration parameter indicating whether a new round robin order should + * be created for every task. Default is {@code true}. + */ + @IgniteMXBeanDescription("Configuration parameter indicating whether a new round robin order should be created for every task.") + public boolean isPerTask(); +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/weightedrandom/WeightedRandomLoadBalancingSpi.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/weightedrandom/WeightedRandomLoadBalancingSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/weightedrandom/WeightedRandomLoadBalancingSpi.java index 182429a..c4a83bc 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/weightedrandom/WeightedRandomLoadBalancingSpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/weightedrandom/WeightedRandomLoadBalancingSpi.java @@ -160,7 +160,7 @@ import static org.apache.ignite.events.IgniteEventType.*; @IgniteSpiMultipleInstancesSupport(true) @IgniteSpiConsistencyChecked(optional = true) public class WeightedRandomLoadBalancingSpi extends IgniteSpiAdapter implements LoadBalancingSpi, - WeightedRandomLoadBalancingSpiMBean { + WeightedRandomLoadBalancingSpiMXBean { /** Random number generator. */ private static final Random RAND = new Random(); @@ -243,7 +243,7 @@ public class WeightedRandomLoadBalancingSpi extends IgniteSpiAdapter implements log.debug(configInfo("nodeWeight", nodeWeight)); } - registerMBean(gridName, this, WeightedRandomLoadBalancingSpiMBean.class); + registerMXBean(gridName, this, WeightedRandomLoadBalancingSpiMXBean.class); // Ack ok start. if (log.isDebugEnabled()) @@ -252,7 +252,7 @@ public class WeightedRandomLoadBalancingSpi extends IgniteSpiAdapter implements /** {@inheritDoc} */ @Override public void spiStop() throws IgniteSpiException { - unregisterMBean(); + unregisterMXBean(); // Ack ok stop. if (log.isDebugEnabled()) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/weightedrandom/WeightedRandomLoadBalancingSpiMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/weightedrandom/WeightedRandomLoadBalancingSpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/weightedrandom/WeightedRandomLoadBalancingSpiMBean.java deleted file mode 100644 index 5a65466..0000000 --- a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/weightedrandom/WeightedRandomLoadBalancingSpiMBean.java +++ /dev/null @@ -1,45 +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.spi.loadbalancing.weightedrandom; - -import org.apache.ignite.mxbean.*; -import org.apache.ignite.spi.*; - -/** - * Management MBean for {@link WeightedRandomLoadBalancingSpi} SPI. - */ -@IgniteMXBeanDescription("MBean that provides access to weighted random load balancing SPI configuration.") -public interface WeightedRandomLoadBalancingSpiMBean extends IgniteSpiManagementMBean { - /** - * Checks whether node weights are considered when doing - * random load balancing. - * - * @return If {@code true} then random load is distributed according - * to node weights. - */ - @IgniteMXBeanDescription("Whether node weights are considered when doing random load balancing.") - public boolean isUseWeights(); - - /** - * Gets weight of this node. - * - * @return Weight of this node. - */ - @IgniteMXBeanDescription("Weight of this node.") - public int getNodeWeight(); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/weightedrandom/WeightedRandomLoadBalancingSpiMXBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/weightedrandom/WeightedRandomLoadBalancingSpiMXBean.java b/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/weightedrandom/WeightedRandomLoadBalancingSpiMXBean.java new file mode 100644 index 0000000..7cf56ef --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/spi/loadbalancing/weightedrandom/WeightedRandomLoadBalancingSpiMXBean.java @@ -0,0 +1,45 @@ +/* + * 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.spi.loadbalancing.weightedrandom; + +import org.apache.ignite.mxbean.*; +import org.apache.ignite.spi.*; + +/** + * Management MBean for {@link WeightedRandomLoadBalancingSpi} SPI. + */ +@IgniteMXBeanDescription("MXBean that provides access to weighted random load balancing SPI configuration.") +public interface WeightedRandomLoadBalancingSpiMXBean extends IgniteSpiManagementMXBean { + /** + * Checks whether node weights are considered when doing + * random load balancing. + * + * @return If {@code true} then random load is distributed according + * to node weights. + */ + @IgniteMXBeanDescription("Whether node weights are considered when doing random load balancing.") + public boolean isUseWeights(); + + /** + * Gets weight of this node. + * + * @return Weight of this node. + */ + @IgniteMXBeanDescription("Weight of this node.") + public int getNodeWeight(); +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/spi/securesession/noop/NoopSecureSessionSpi.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/securesession/noop/NoopSecureSessionSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/securesession/noop/NoopSecureSessionSpi.java index 20c2535..8550e89 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/securesession/noop/NoopSecureSessionSpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/securesession/noop/NoopSecureSessionSpi.java @@ -68,7 +68,7 @@ import java.util.*; @IgniteSpiNoop @IgniteSpiMultipleInstancesSupport(true) public class NoopSecureSessionSpi extends IgniteSpiAdapter - implements SecureSessionSpi, NoopSecureSessionSpiMBean { + implements SecureSessionSpi, NoopSecureSessionSpiMXBean { /** Empty bytes array. */ private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; @@ -100,7 +100,7 @@ public class NoopSecureSessionSpi extends IgniteSpiAdapter // Start SPI start stopwatch. startStopwatch(); - registerMBean(gridName, this, NoopSecureSessionSpiMBean.class); + registerMXBean(gridName, this, NoopSecureSessionSpiMXBean.class); // Ack ok start. if (log.isDebugEnabled()) @@ -109,7 +109,7 @@ public class NoopSecureSessionSpi extends IgniteSpiAdapter /** {@inheritDoc} */ @Override public void spiStop() throws IgniteSpiException { - unregisterMBean(); + unregisterMXBean(); // Ack ok stop. if (log.isDebugEnabled()) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/spi/securesession/noop/NoopSecureSessionSpiMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/securesession/noop/NoopSecureSessionSpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/securesession/noop/NoopSecureSessionSpiMBean.java deleted file mode 100644 index 3fe951d..0000000 --- a/modules/core/src/main/java/org/apache/ignite/spi/securesession/noop/NoopSecureSessionSpiMBean.java +++ /dev/null @@ -1,29 +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.spi.securesession.noop; - -import org.apache.ignite.mxbean.*; -import org.apache.ignite.spi.*; - -/** - * Management bean for {@link NoopSecureSessionSpi}. - */ -@IgniteMXBeanDescription("MBean that provides access to no-op secure session SPI configuration.") -public interface NoopSecureSessionSpiMBean extends IgniteSpiManagementMBean { - // No-op. -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/spi/securesession/noop/NoopSecureSessionSpiMXBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/securesession/noop/NoopSecureSessionSpiMXBean.java b/modules/core/src/main/java/org/apache/ignite/spi/securesession/noop/NoopSecureSessionSpiMXBean.java new file mode 100644 index 0000000..2da758e --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/spi/securesession/noop/NoopSecureSessionSpiMXBean.java @@ -0,0 +1,29 @@ +/* + * 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.spi.securesession.noop; + +import org.apache.ignite.mxbean.*; +import org.apache.ignite.spi.*; + +/** + * Management bean for {@link NoopSecureSessionSpi}. + */ +@IgniteMXBeanDescription("MXBean that provides access to no-op secure session SPI configuration.") +public interface NoopSecureSessionSpiMXBean extends IgniteSpiManagementMXBean { + // No-op. +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java index a5782ea..53cd050 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java @@ -100,7 +100,7 @@ import static org.apache.ignite.events.IgniteEventType.*; */ @IgniteSpiMultipleInstancesSupport(true) @SuppressWarnings({"PackageVisibleInnerClass", "PackageVisibleField"}) -public class FileSwapSpaceSpi extends IgniteSpiAdapter implements SwapSpaceSpi, FileSwapSpaceSpiMBean { +public class FileSwapSpaceSpi extends IgniteSpiAdapter implements SwapSpaceSpi, FileSwapSpaceSpiMXBean { /** * Default base directory. Note that this path is relative to {@code GRIDGAIN_HOME/work} folder * if {@code GRIDGAIN_HOME} system or environment variable specified, otherwise it is relative to @@ -254,7 +254,7 @@ public class FileSwapSpaceSpi extends IgniteSpiAdapter implements SwapSpaceSpi, startStopwatch(); - registerMBean(gridName, this, FileSwapSpaceSpiMBean.class); + registerMXBean(gridName, this, FileSwapSpaceSpiMXBean.class); String path = baseDir + File.separator + gridName + File.separator + ignite.configuration().getNodeId(); @@ -271,7 +271,7 @@ public class FileSwapSpaceSpi extends IgniteSpiAdapter implements SwapSpaceSpi, /** {@inheritDoc} */ @Override public void spiStop() throws IgniteSpiException { - unregisterMBean(); + unregisterMXBean(); for (Space space : spaces.values()) { space.initialize(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpiMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpiMBean.java deleted file mode 100644 index 8c1caeb..0000000 --- a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpiMBean.java +++ /dev/null @@ -1,67 +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.spi.swapspace.file; - -import org.apache.ignite.mxbean.*; -import org.apache.ignite.spi.*; - -/** - * Management bean for {@link FileSwapSpaceSpi}. - */ -@IgniteMXBeanDescription("MBean that provides configuration information on file-based swapspace SPI.") -public interface FileSwapSpaceSpiMBean extends IgniteSpiManagementMBean { - /** - * Gets base directory. - * - * @return Base directory. - */ - @IgniteMXBeanDescription("Base directory.") - public String getBaseDirectory(); - - /** - * Gets maximum sparsity. - * - * @return Maximum sparsity. - */ - @IgniteMXBeanDescription("Maximum sparsity.") - public float getMaximumSparsity(); - - /** - * Gets write buffer size in bytes. - * - * @return Write buffer size in bytes. - */ - @IgniteMXBeanDescription("Write buffer size in bytes.") - public int getWriteBufferSize(); - - /** - * Gets max write queue size in bytes. - * - * @return Max write queue size in bytes. - */ - @IgniteMXBeanDescription("Max write queue size in bytes.") - public int getMaxWriteQueueSize(); - - /** - * Gets read pool size. - * - * @return Read pool size. - */ - @IgniteMXBeanDescription("Read pool size.") - public int getReadStripesNumber(); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpiMXBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpiMXBean.java b/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpiMXBean.java new file mode 100644 index 0000000..4fdaa16 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpiMXBean.java @@ -0,0 +1,67 @@ +/* + * 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.spi.swapspace.file; + +import org.apache.ignite.mxbean.*; +import org.apache.ignite.spi.*; + +/** + * Management bean for {@link FileSwapSpaceSpi}. + */ +@IgniteMXBeanDescription("MXBean that provides configuration information on file-based swapspace SPI.") +public interface FileSwapSpaceSpiMXBean extends IgniteSpiManagementMXBean { + /** + * Gets base directory. + * + * @return Base directory. + */ + @IgniteMXBeanDescription("Base directory.") + public String getBaseDirectory(); + + /** + * Gets maximum sparsity. + * + * @return Maximum sparsity. + */ + @IgniteMXBeanDescription("Maximum sparsity.") + public float getMaximumSparsity(); + + /** + * Gets write buffer size in bytes. + * + * @return Write buffer size in bytes. + */ + @IgniteMXBeanDescription("Write buffer size in bytes.") + public int getWriteBufferSize(); + + /** + * Gets max write queue size in bytes. + * + * @return Max write queue size in bytes. + */ + @IgniteMXBeanDescription("Max write queue size in bytes.") + public int getMaxWriteQueueSize(); + + /** + * Gets read pool size. + * + * @return Read pool size. + */ + @IgniteMXBeanDescription("Read pool size.") + public int getReadStripesNumber(); +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/streamer/StreamerMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/streamer/StreamerMBean.java b/modules/core/src/main/java/org/apache/ignite/streamer/StreamerMBean.java deleted file mode 100644 index cdc944d..0000000 --- a/modules/core/src/main/java/org/apache/ignite/streamer/StreamerMBean.java +++ /dev/null @@ -1,169 +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.streamer; - -import org.apache.ignite.mxbean.*; -import org.jetbrains.annotations.*; - -/** - * Streamer MBean interface. - */ -@IgniteMXBeanDescription("MBean that provides access to streamer description and metrics.") -public interface StreamerMBean { - /** - * Gets streamer name. - * - * @return Streamer name. - */ - @IgniteMXBeanDescription("Streamer name.") - @Nullable public String getName(); - - /** - * Gets {@code atLeastOnce} configuration flag. - * - * @return {@code True} if {@code atLeastOnce} is configured. - */ - @IgniteMXBeanDescription("True if atLeastOnce is configured.") - public boolean isAtLeastOnce(); - - /** - * Gets size of stage futures map. This map is maintained only when {@code atLeastOnce} configuration - * flag is set to true. - * - * @return Stage future map size. - */ - @IgniteMXBeanDescription("Stage future map size.") - public int getStageFutureMapSize(); - - /** - * Gets size of batch futures map. - * - * @return Batch future map size. - */ - @IgniteMXBeanDescription("Batch future map size.") - public int getBatchFutureMapSize(); - - /** - * Gets number of stages currently being executed in streamer pool. - * - * @return Number of stages. Cannot be more than pool thread count. - */ - @IgniteMXBeanDescription("Number of stages currently being executed in streamer pool.") - public int getStageActiveExecutionCount(); - - /** - * Gets number of event batches currently waiting to be executed. - * - * @return Number of event batches waiting to be processed. - */ - @IgniteMXBeanDescription("Number of event batches currently waiting to be executed.") - public int getStageWaitingExecutionCount(); - - /** - * Gets total number of stages executed since last reset. - * - * @return Total number of stages executed since last reset. - */ - @IgniteMXBeanDescription("Total number of stages executed since last reset.") - public long getStageTotalExecutionCount(); - - /** - * Gets pipeline maximum execution time, i.e. time between execution start and time when last stage in pipeline - * returned empty map. If pipeline execution was split to different nodes, metrics for each split will be - * recorded independently. - * - * @return Pipeline maximum execution time. - */ - @IgniteMXBeanDescription("Pipeline maximum execution time.") - public long getPipelineMaximumExecutionTime(); - - /** - * Gets pipeline minimum execution time, i.e. time between execution start and time when last stage in pipeline - * returned empty map. If pipeline execution was split to different nodes, metrics for each split will be - * recorded independently. - * - * @return Pipeline minimum execution time. - */ - @IgniteMXBeanDescription("Pipeline minimum execution time.") - public long getPipelineMinimumExecutionTime(); - - /** - * Gets pipeline average execution time, i.e. time between execution start and time when last stage in pipeline - * returned empty map. If pipeline execution was split, metrics for each split will be recorded independently. - * - * @return Pipeline average execution time. - */ - @IgniteMXBeanDescription("Pipeline average execution time.") - public long getPipelineAverageExecutionTime(); - - /** - * Gets maximum number of unique nodes participated in pipeline execution. If pipeline execution was split, - * metrics for each split will be recorded independently. - * - * @return Maximum number of unique nodes in pipeline execution. - */ - @IgniteMXBeanDescription("Maximum number of unique nodes participated in pipeline execution.") - public int getPipelineMaximumExecutionNodes(); - - /** - * Gets minimum number of unique nodes participated in pipeline execution. If pipeline execution was split, - * metrics for each split will be recorded independently. - * - * @return Minimum number of unique nodes in pipeline execution. - */ - @IgniteMXBeanDescription("Minimum number of unique nodes participated in pipeline execution.") - public int getPipelineMinimumExecutionNodes(); - - /** - * Gets average number of unique nodes participated in pipeline execution. If pipeline execution was split, - * metrics for each split will be recorded independently. - * - * @return Average number of unique nodes in pipeline execution. - */ - @IgniteMXBeanDescription("Average number of unique nodes participated in pipeline execution.") - public int getPipelineAverageExecutionNodes(); - - /** - * Gets number of current active sessions. Since event execution sessions are tracked only when - * {@code atLeastOnce} configuration property is set to {@code true}, this metric will be collected - * only in this case. When {@code atLeastOnce} is set to {@code false}, this metric will always be zero. - * - * @return Number of current active sessions. - */ - @IgniteMXBeanDescription("Number of current active sessions.") - public int getCurrentActiveSessions(); - - /** - * Gets maximum number of active sessions since last reset. Since event execution sessions are tracked only when - * {@code atLeastOnce} configuration property is set to {@code true}, this metric will be collected - * only in this case. When {@code atLeastOnce} is set to {@code false}, this metric will always be zero. - * - * @return Maximum active sessions since last reset. - */ - @IgniteMXBeanDescription("Maximum number of active sessions since last reset.") - public int getMaximumActiveSessions(); - - /** - * Gets number of failures since last reset. If {@code atLeastOnce} flag is set to steamer configuration, - * then only root node failures will be counted. Otherwise each node will count failures independently. - * - * @return Failures count. - */ - @IgniteMXBeanDescription("Number of failures since last reset.") - public int getFailuresCount(); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/streamer/StreamerMXBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/streamer/StreamerMXBean.java b/modules/core/src/main/java/org/apache/ignite/streamer/StreamerMXBean.java new file mode 100644 index 0000000..6055a6b --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/streamer/StreamerMXBean.java @@ -0,0 +1,169 @@ +/* + * 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.streamer; + +import org.apache.ignite.mxbean.*; +import org.jetbrains.annotations.*; + +/** + * Streamer MBean interface. + */ +@IgniteMXBeanDescription("MXBean that provides access to streamer description and metrics.") +public interface StreamerMXBean { + /** + * Gets streamer name. + * + * @return Streamer name. + */ + @IgniteMXBeanDescription("Streamer name.") + @Nullable public String getName(); + + /** + * Gets {@code atLeastOnce} configuration flag. + * + * @return {@code True} if {@code atLeastOnce} is configured. + */ + @IgniteMXBeanDescription("True if atLeastOnce is configured.") + public boolean isAtLeastOnce(); + + /** + * Gets size of stage futures map. This map is maintained only when {@code atLeastOnce} configuration + * flag is set to true. + * + * @return Stage future map size. + */ + @IgniteMXBeanDescription("Stage future map size.") + public int getStageFutureMapSize(); + + /** + * Gets size of batch futures map. + * + * @return Batch future map size. + */ + @IgniteMXBeanDescription("Batch future map size.") + public int getBatchFutureMapSize(); + + /** + * Gets number of stages currently being executed in streamer pool. + * + * @return Number of stages. Cannot be more than pool thread count. + */ + @IgniteMXBeanDescription("Number of stages currently being executed in streamer pool.") + public int getStageActiveExecutionCount(); + + /** + * Gets number of event batches currently waiting to be executed. + * + * @return Number of event batches waiting to be processed. + */ + @IgniteMXBeanDescription("Number of event batches currently waiting to be executed.") + public int getStageWaitingExecutionCount(); + + /** + * Gets total number of stages executed since last reset. + * + * @return Total number of stages executed since last reset. + */ + @IgniteMXBeanDescription("Total number of stages executed since last reset.") + public long getStageTotalExecutionCount(); + + /** + * Gets pipeline maximum execution time, i.e. time between execution start and time when last stage in pipeline + * returned empty map. If pipeline execution was split to different nodes, metrics for each split will be + * recorded independently. + * + * @return Pipeline maximum execution time. + */ + @IgniteMXBeanDescription("Pipeline maximum execution time.") + public long getPipelineMaximumExecutionTime(); + + /** + * Gets pipeline minimum execution time, i.e. time between execution start and time when last stage in pipeline + * returned empty map. If pipeline execution was split to different nodes, metrics for each split will be + * recorded independently. + * + * @return Pipeline minimum execution time. + */ + @IgniteMXBeanDescription("Pipeline minimum execution time.") + public long getPipelineMinimumExecutionTime(); + + /** + * Gets pipeline average execution time, i.e. time between execution start and time when last stage in pipeline + * returned empty map. If pipeline execution was split, metrics for each split will be recorded independently. + * + * @return Pipeline average execution time. + */ + @IgniteMXBeanDescription("Pipeline average execution time.") + public long getPipelineAverageExecutionTime(); + + /** + * Gets maximum number of unique nodes participated in pipeline execution. If pipeline execution was split, + * metrics for each split will be recorded independently. + * + * @return Maximum number of unique nodes in pipeline execution. + */ + @IgniteMXBeanDescription("Maximum number of unique nodes participated in pipeline execution.") + public int getPipelineMaximumExecutionNodes(); + + /** + * Gets minimum number of unique nodes participated in pipeline execution. If pipeline execution was split, + * metrics for each split will be recorded independently. + * + * @return Minimum number of unique nodes in pipeline execution. + */ + @IgniteMXBeanDescription("Minimum number of unique nodes participated in pipeline execution.") + public int getPipelineMinimumExecutionNodes(); + + /** + * Gets average number of unique nodes participated in pipeline execution. If pipeline execution was split, + * metrics for each split will be recorded independently. + * + * @return Average number of unique nodes in pipeline execution. + */ + @IgniteMXBeanDescription("Average number of unique nodes participated in pipeline execution.") + public int getPipelineAverageExecutionNodes(); + + /** + * Gets number of current active sessions. Since event execution sessions are tracked only when + * {@code atLeastOnce} configuration property is set to {@code true}, this metric will be collected + * only in this case. When {@code atLeastOnce} is set to {@code false}, this metric will always be zero. + * + * @return Number of current active sessions. + */ + @IgniteMXBeanDescription("Number of current active sessions.") + public int getCurrentActiveSessions(); + + /** + * Gets maximum number of active sessions since last reset. Since event execution sessions are tracked only when + * {@code atLeastOnce} configuration property is set to {@code true}, this metric will be collected + * only in this case. When {@code atLeastOnce} is set to {@code false}, this metric will always be zero. + * + * @return Maximum active sessions since last reset. + */ + @IgniteMXBeanDescription("Maximum number of active sessions since last reset.") + public int getMaximumActiveSessions(); + + /** + * Gets number of failures since last reset. If {@code atLeastOnce} flag is set to steamer configuration, + * then only root node failures will be counted. Otherwise each node will count failures independently. + * + * @return Failures count. + */ + @IgniteMXBeanDescription("Number of failures since last reset.") + public int getFailuresCount(); +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/streamer/StreamerStageMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/streamer/StreamerStageMBean.java b/modules/core/src/main/java/org/apache/ignite/streamer/StreamerStageMBean.java deleted file mode 100644 index 5651f7c..0000000 --- a/modules/core/src/main/java/org/apache/ignite/streamer/StreamerStageMBean.java +++ /dev/null @@ -1,114 +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.streamer; - -import org.apache.ignite.mxbean.*; - -/** - * Streamer stage MBean. - */ -@IgniteMXBeanDescription("MBean that provides access to streamer stage description and metrics.") -public interface StreamerStageMBean { - /** - * Gets stage name. - * - * @return Stage name. - */ - @IgniteMXBeanDescription("Stage name.") - public String getName(); - - /** - * Gets stage class name. - * - * @return Stage class name. - */ - @IgniteMXBeanDescription("Stage class name.") - public String getStageClassName(); - - /** - * Gets stage minimum execution time. - * - * @return Stage minimum execution time. - */ - @IgniteMXBeanDescription("Stage minimum execution time.") - public long getMinimumExecutionTime(); - - /** - * Gets stage maximum execution time. - * - * @return Stage maximum execution time. - */ - @IgniteMXBeanDescription("Stage maximum execution time.") - public long getMaximumExecutionTime(); - - /** - * Gets stage average execution time. - * - * @return Stage average execution time. - */ - @IgniteMXBeanDescription("Stage average execution time.") - public long getAverageExecutionTime(); - - /** - * Gets stage minimum waiting time. - * - * @return Stage minimum waiting time. - */ - @IgniteMXBeanDescription("Stage minimum waiting time.") - public long getMinimumWaitingTime(); - - /** - * Gets stage maximum waiting time. - * - * @return Stage maximum waiting time. - */ - @IgniteMXBeanDescription("Stage maximum waiting time.") - public long getMaximumWaitingTime(); - - /** - * Stage average waiting time. - * - * @return Stage average waiting time. - */ - @IgniteMXBeanDescription("Stage average waiting time.") - public long getAverageWaitingTime(); - - /** - * Gets total stage execution count since last reset. - * - * @return Number of times this stage was executed. - */ - @IgniteMXBeanDescription("Number of times this stage was executed.") - public long getTotalExecutionCount(); - - /** - * Gets stage failure count. - * - * @return Stage failure count. - */ - @IgniteMXBeanDescription("Stage failure count.") - public int getFailuresCount(); - - /** - * Gets flag indicating if stage is being currently executed by at least one thread on current node. - * - * @return {@code True} if stage is executing now. - */ - @IgniteMXBeanDescription("Whether stage is currently being executed.") - public boolean isExecuting(); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/streamer/StreamerStageMXBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/streamer/StreamerStageMXBean.java b/modules/core/src/main/java/org/apache/ignite/streamer/StreamerStageMXBean.java new file mode 100644 index 0000000..b501caa --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/streamer/StreamerStageMXBean.java @@ -0,0 +1,114 @@ +/* + * 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.streamer; + +import org.apache.ignite.mxbean.*; + +/** + * Streamer stage MBean. + */ +@IgniteMXBeanDescription("MXBean that provides access to streamer stage description and metrics.") +public interface StreamerStageMXBean { + /** + * Gets stage name. + * + * @return Stage name. + */ + @IgniteMXBeanDescription("Stage name.") + public String getName(); + + /** + * Gets stage class name. + * + * @return Stage class name. + */ + @IgniteMXBeanDescription("Stage class name.") + public String getStageClassName(); + + /** + * Gets stage minimum execution time. + * + * @return Stage minimum execution time. + */ + @IgniteMXBeanDescription("Stage minimum execution time.") + public long getMinimumExecutionTime(); + + /** + * Gets stage maximum execution time. + * + * @return Stage maximum execution time. + */ + @IgniteMXBeanDescription("Stage maximum execution time.") + public long getMaximumExecutionTime(); + + /** + * Gets stage average execution time. + * + * @return Stage average execution time. + */ + @IgniteMXBeanDescription("Stage average execution time.") + public long getAverageExecutionTime(); + + /** + * Gets stage minimum waiting time. + * + * @return Stage minimum waiting time. + */ + @IgniteMXBeanDescription("Stage minimum waiting time.") + public long getMinimumWaitingTime(); + + /** + * Gets stage maximum waiting time. + * + * @return Stage maximum waiting time. + */ + @IgniteMXBeanDescription("Stage maximum waiting time.") + public long getMaximumWaitingTime(); + + /** + * Stage average waiting time. + * + * @return Stage average waiting time. + */ + @IgniteMXBeanDescription("Stage average waiting time.") + public long getAverageWaitingTime(); + + /** + * Gets total stage execution count since last reset. + * + * @return Number of times this stage was executed. + */ + @IgniteMXBeanDescription("Number of times this stage was executed.") + public long getTotalExecutionCount(); + + /** + * Gets stage failure count. + * + * @return Stage failure count. + */ + @IgniteMXBeanDescription("Stage failure count.") + public int getFailuresCount(); + + /** + * Gets flag indicating if stage is being currently executed by at least one thread on current node. + * + * @return {@code True} if stage is executing now. + */ + @IgniteMXBeanDescription("Whether stage is currently being executed.") + public boolean isExecuting(); +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/streamer/StreamerWindowMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/streamer/StreamerWindowMBean.java b/modules/core/src/main/java/org/apache/ignite/streamer/StreamerWindowMBean.java deleted file mode 100644 index 4a78d1d..0000000 --- a/modules/core/src/main/java/org/apache/ignite/streamer/StreamerWindowMBean.java +++ /dev/null @@ -1,58 +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.streamer; - -import org.apache.ignite.mxbean.*; - -/** - * Streamer window MBean. - */ -@IgniteMXBeanDescription("MBean that provides access to streamer window description.") -public interface StreamerWindowMBean { - /** - * Gets window name. - * - * @return Window name. - */ - @IgniteMXBeanDescription("Window name.") - public String getName(); - - /** - * Gets window class name. - * - * @return Window class name. - */ - @IgniteMXBeanDescription("Window class name.") - public String getClassName(); - - /** - * Gets current window size. - * - * @return Current window size. - */ - @IgniteMXBeanDescription("Window size.") - public int getSize(); - - /** - * Gets estimate for window eviction queue size. - * - * @return Eviction queue size estimate. - */ - @IgniteMXBeanDescription("Eviction queue size estimate.") - public int getEvictionQueueSize(); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/streamer/StreamerWindowMXBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/streamer/StreamerWindowMXBean.java b/modules/core/src/main/java/org/apache/ignite/streamer/StreamerWindowMXBean.java new file mode 100644 index 0000000..015428a --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/streamer/StreamerWindowMXBean.java @@ -0,0 +1,58 @@ +/* + * 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.streamer; + +import org.apache.ignite.mxbean.*; + +/** + * Streamer window MXBean. + */ +@IgniteMXBeanDescription("MXBean that provides access to streamer window description.") +public interface StreamerWindowMXBean { + /** + * Gets window name. + * + * @return Window name. + */ + @IgniteMXBeanDescription("Window name.") + public String getName(); + + /** + * Gets window class name. + * + * @return Window class name. + */ + @IgniteMXBeanDescription("Window class name.") + public String getClassName(); + + /** + * Gets current window size. + * + * @return Current window size. + */ + @IgniteMXBeanDescription("Window size.") + public int getSize(); + + /** + * Gets estimate for window eviction queue size. + * + * @return Eviction queue size estimate. + */ + @IgniteMXBeanDescription("Eviction queue size estimate.") + public int getEvictionQueueSize(); +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/streamer/index/StreamerIndexProvider.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/streamer/index/StreamerIndexProvider.java b/modules/core/src/main/java/org/apache/ignite/streamer/index/StreamerIndexProvider.java index 045c9b0..cd8b6df 100644 --- a/modules/core/src/main/java/org/apache/ignite/streamer/index/StreamerIndexProvider.java +++ b/modules/core/src/main/java/org/apache/ignite/streamer/index/StreamerIndexProvider.java @@ -26,7 +26,7 @@ import org.apache.ignite.*; * To configure index for a streamer window, use * {@link org.apache.ignite.streamer.window.StreamerWindowAdapter#setIndexes(StreamerIndexProvider[])}. */ -public interface StreamerIndexProvider<E, K, V> extends StreamerIndexProviderMBean { +public interface StreamerIndexProvider<E, K, V> extends StreamerIndexProviderMXBean { /** * Gets index name. * http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/streamer/index/StreamerIndexProviderMBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/streamer/index/StreamerIndexProviderMBean.java b/modules/core/src/main/java/org/apache/ignite/streamer/index/StreamerIndexProviderMBean.java deleted file mode 100644 index c162215..0000000 --- a/modules/core/src/main/java/org/apache/ignite/streamer/index/StreamerIndexProviderMBean.java +++ /dev/null @@ -1,74 +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.streamer.index; - -import org.apache.ignite.mxbean.*; -import org.jetbrains.annotations.*; - -/** - * Streamer window index provider MBean. - */ -public interface StreamerIndexProviderMBean { - /** - * Index name. - * - * @return Index name. - */ - @IgniteMXBeanDescription("Index name.") - @Nullable public String name(); - - /** - * Gets index updater class name. - * - * @return Index updater class. - */ - @IgniteMXBeanDescription("Index updater class name.") - public String updaterClass(); - - /** - * Gets index unique flag. - * - * @return Index unique flag. - */ - @IgniteMXBeanDescription("Index unique flag.") - public boolean unique(); - - /** - * Returns {@code true} if index supports sorting and therefore can perform range operations. - * - * @return Index sorted flag. - */ - @IgniteMXBeanDescription("Index sorted flag.") - public boolean sorted(); - - /** - * Gets index policy. - * - * @return Index policy. - */ - @IgniteMXBeanDescription("Index policy.") - public StreamerIndexPolicy policy(); - - /** - * Gets current index size. - * - * @return Current index size. - */ - @IgniteMXBeanDescription("Current index size.") - public int size(); -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/streamer/index/StreamerIndexProviderMXBean.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/streamer/index/StreamerIndexProviderMXBean.java b/modules/core/src/main/java/org/apache/ignite/streamer/index/StreamerIndexProviderMXBean.java new file mode 100644 index 0000000..bd3be7e --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/streamer/index/StreamerIndexProviderMXBean.java @@ -0,0 +1,74 @@ +/* + * 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.streamer.index; + +import org.apache.ignite.mxbean.*; +import org.jetbrains.annotations.*; + +/** + * Streamer window index provider MXBean. + */ +public interface StreamerIndexProviderMXBean { + /** + * Index name. + * + * @return Index name. + */ + @IgniteMXBeanDescription("Index name.") + @Nullable public String name(); + + /** + * Gets index updater class name. + * + * @return Index updater class. + */ + @IgniteMXBeanDescription("Index updater class name.") + public String updaterClass(); + + /** + * Gets index unique flag. + * + * @return Index unique flag. + */ + @IgniteMXBeanDescription("Index unique flag.") + public boolean unique(); + + /** + * Returns {@code true} if index supports sorting and therefore can perform range operations. + * + * @return Index sorted flag. + */ + @IgniteMXBeanDescription("Index sorted flag.") + public boolean sorted(); + + /** + * Gets index policy. + * + * @return Index policy. + */ + @IgniteMXBeanDescription("Index policy.") + public StreamerIndexPolicy policy(); + + /** + * Gets current index size. + * + * @return Current index size. + */ + @IgniteMXBeanDescription("Current index size.") + public int size(); +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/main/java/org/apache/ignite/streamer/window/StreamerWindowAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/streamer/window/StreamerWindowAdapter.java b/modules/core/src/main/java/org/apache/ignite/streamer/window/StreamerWindowAdapter.java index 18337e4..0f1ab25 100644 --- a/modules/core/src/main/java/org/apache/ignite/streamer/window/StreamerWindowAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/streamer/window/StreamerWindowAdapter.java @@ -34,7 +34,7 @@ import java.util.*; * Streamer window adapter. */ public abstract class StreamerWindowAdapter<E> implements LifecycleAware, StreamerWindow<E>, - StreamerWindowMBean { + StreamerWindowMXBean { /** Default window name. */ private String name = getClass().getSimpleName(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java index 87d38b7..e0876bc 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteUtilSelfTestSuite.java @@ -48,7 +48,7 @@ public class IgniteUtilSelfTestSuite extends TestSuite { suite.addTestSuite(GridStringBuilderFactorySelfTest.class); suite.addTestSuite(GridToStringBuilderSelfTest.class); suite.addTestSuite(GridByteArrayListSelfTest.class); - suite.addTestSuite(GridMBeanSelfTest.class); + suite.addTestSuite(IgniteMXBeanSelfTest.class); suite.addTestSuite(GridLongListSelfTest.class); suite.addTestSuite(GridCacheUtilsSelfTest.class); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/test/java/org/apache/ignite/util/mbeans/GridMBeanSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/util/mbeans/GridMBeanSelfTest.java b/modules/core/src/test/java/org/apache/ignite/util/mbeans/GridMBeanSelfTest.java deleted file mode 100644 index 4facba8..0000000 --- a/modules/core/src/test/java/org/apache/ignite/util/mbeans/GridMBeanSelfTest.java +++ /dev/null @@ -1,345 +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.util.mbeans; - -import org.apache.ignite.internal.mxbean.*; -import org.apache.ignite.mxbean.*; -import org.apache.ignite.testframework.junits.common.*; -import javax.management.*; - -/** - * MBean test. - */ -public class GridMBeanSelfTest extends GridCommonAbstractTest { - /** - * Tests correct MBean interface. - * - * @throws Exception Thrown if test fails. - */ - public void testCorrectMBeanInfo() throws Exception { - StandardMBean mbean = new IgniteStandardMXBean(new GridMBeanImplementation(), GridMBeanInterface.class); - - MBeanInfo info = mbean.getMBeanInfo(); - - assert info.getDescription().equals("MBeanDescription.") == true; - - assert info.getOperations().length == 2; - - for (MBeanOperationInfo opInfo: info.getOperations()) { - if (opInfo.getDescription().equals("MBeanOperation.")) - assert opInfo.getSignature().length == 2; - else { - assert opInfo.getDescription().equals("MBeanSuperOperation.") == true; - assert opInfo.getSignature().length == 1; - } - } - - for (MBeanParameterInfo paramInfo: info.getOperations()[0].getSignature()) { - if (paramInfo.getName().equals("ignored")) - assert paramInfo.getDescription().equals("MBeanOperationParameter1.") == true; - else { - assert paramInfo.getName().equals("someData") == true; - assert paramInfo.getDescription().equals("MBeanOperationParameter2.") == true; - } - } - - assert info.getAttributes().length == 4: "Expected 4 attributes but got " + info.getAttributes().length; - - for (MBeanAttributeInfo attrInfo: info.getAttributes()) { - if (attrInfo.isWritable() == false) { - assert (attrInfo.getDescription().equals("MBeanReadonlyGetter.") == true || - attrInfo.getDescription().equals("MBeanROGetter.")); - } - else { - assert (attrInfo.getDescription().equals("MBeanWritableGetter.") == true || - attrInfo.getDescription().equals("MBeanWritableIsGetter.")); - } - } - } - - /** - * Tests correct MBean interface. - * @throws Exception Thrown if test fails. - */ - public void testMissedNameMBeanInfo() throws Exception { - try { - StandardMBean mbean = new IgniteStandardMXBean(new GridMBeanImplementation(), GridMBeanInterfaceBad.class); - - mbean.getMBeanInfo(); - } - catch (AssertionError e) { - return; - } - - assert false; - } - - /** - * Tests correct MBean interface. - * @throws Exception Thrown if test fails. - */ - public void testMissedDescriptionMBeanInfo() throws Exception { - try { - StandardMBean mbean = new IgniteStandardMXBean(new GridMBeanImplementation(), - GridMBeanInterfaceBadAgain.class); - - mbean.getMBeanInfo(); - } - catch (AssertionError e) { - return; - } - - assert false; - } - - /** - * Tests correct MBean interface. - * @throws Exception Thrown if test fails. - */ - public void testEmptyDescriptionMBeanInfo() throws Exception { - try { - StandardMBean mbean = new IgniteStandardMXBean(new GridMBeanImplementation(), - GridMBeanInterfaceEmptyDescription.class); - - mbean.getMBeanInfo(); - } - catch (AssertionError e) { - return; - } - - assert false; - } - - /** - * Tests correct MBean interface. - * @throws Exception Thrown if test fails. - */ - public void testEmptyNameMBeanInfo() throws Exception { - try { - StandardMBean mbean = new IgniteStandardMXBean(new GridMBeanImplementation(), - GridMBeanInterfaceEmptyName.class); - - mbean.getMBeanInfo(); - } - catch (AssertionError e) { - return; - } - - assert false; - } - - /** - * Super interface for {@link GridMBeanInterface}. - */ - public static interface GridMBeanSuperInterface { - /** - * Test getter. - * - * @return Some string. - */ - @IgniteMXBeanDescription("MBeanROGetter.") - public String getROData(); - - /** - * Test MBean operation. - * - * @param someData Some data. - * @return Some string. - */ - @IgniteMXBeanDescription("MBeanSuperOperation.") - @IgniteMXBeanParametersNames({"someData"}) - @IgniteMXBeanParametersDescriptions({"MBeanOperationParameter1."}) - public String doSomethingSuper(String someData); - } - - /** - * Test MBean interface. - */ - @IgniteMXBeanDescription("MBeanDescription.") - public static interface GridMBeanInterface extends GridMBeanSuperInterface { - /** - * Test getter. - * - * @return Some string. - */ - @IgniteMXBeanDescription("MBeanWritableGetter.") - public String getWritableData(); - - /** - * Test setter. - * - * @param data Some string. - */ - public void setWritableData(String data); - - /** - * Test getter. - * - * @return Some string. - */ - @IgniteMXBeanDescription("MBeanReadonlyGetter.") - public String getReadOnlyData(); - - /** - * Test boolean getter. - * - * @return Some string. - */ - @IgniteMXBeanDescription("MBeanWritableIsGetter.") - public boolean isWritable(); - - /** - * Test boolean setter. - * @param isWritable Just a boolean. - */ - public void setWritable(boolean isWritable); - - /** - * Test MBean operation. - * - * @param ignored Some value. - * @param someData Some data. - * @return Some string. - */ - @IgniteMXBeanDescription("MBeanOperation.") - @IgniteMXBeanParametersNames({"ignored", "someData"}) - @IgniteMXBeanParametersDescriptions({"MBeanOperationParameter1.", "MBeanOperationParameter2."}) - public String doSomething(boolean ignored, String someData); - } - - /** - * Test MBean interface. - */ - public static interface GridMBeanInterfaceBad { - /** - * Test MBean operation. - * - * @param ignored Some value. - * @param someData Some data. - * @return Some string. - */ - @IgniteMXBeanDescription("MBeanOperation.") - @IgniteMXBeanParametersNames({"ignored"}) - @IgniteMXBeanParametersDescriptions({"MBeanOperationParameter1.", "MBeanOperationParameter2."}) - public String doSomethingBad(boolean ignored, String someData); - } - - /** - * Test MBean interface. - */ - public static interface GridMBeanInterfaceEmptyDescription { - /** - * Test MBean operation. - * - * @param ignored Some value. - * @param someData Some data. - * @return Some string. - */ - @IgniteMXBeanDescription("") - public String doSomethingBad(boolean ignored, String someData); - } - - /** - * Test MBean interface. - */ - public static interface GridMBeanInterfaceEmptyName { - /** - * Test MBean operation. - * - * @param ignored Some value. - * @param someData Some data. - * @return Some string. - */ - @IgniteMXBeanParametersNames({"", "someData"}) - public String doSomethingBadAgain(boolean ignored, String someData); - } - - /** - * Test MBean interface. - */ - public static interface GridMBeanInterfaceBadAgain { - /** - * Test MBean operation. - * - * @param ignored Some value. - * @param someData Some data. - * @return Some string. - */ - @IgniteMXBeanDescription("MBeanOperation.") - @IgniteMXBeanParametersNames({"ignored", "someData"}) - @IgniteMXBeanParametersDescriptions({"MBeanOperationParameter1."}) - public String doSomethingBadAgain(boolean ignored, String someData); - } - - /** - * Test MBean implementation. - */ - public class GridMBeanImplementation implements GridMBeanInterface, GridMBeanInterfaceBad, - GridMBeanInterfaceBadAgain, GridMBeanInterfaceEmptyDescription, GridMBeanInterfaceEmptyName { - - /** {@inheritDoc} */ - @Override public String doSomething(boolean ignored, String someData) { - return null; - } - - /** {@inheritDoc} */ - @Override public String getReadOnlyData() { - return null; - } - - /** {@inheritDoc} */ - @Override public String getWritableData() { - return null; - } - - /** {@inheritDoc} */ - @Override public void setWritableData(String data) { - // No-op. - } - - /** {@inheritDoc} */ - @Override public String doSomethingBad(boolean ignored, String someData) { - return null; - } - - /** {@inheritDoc} */ - @Override public String doSomethingBadAgain(boolean ignored, String someData) { - return null; - } - - /** {@inheritDoc} */ - @Override public boolean isWritable() { - return false; - } - - /** {@inheritDoc} */ - @Override public void setWritable(boolean isWritable) { - // No-op. - } - - /** {@inheritDoc} */ - @Override public String getROData() { - return null; - } - - /** {@inheritDoc} */ - @Override public String doSomethingSuper(String someData) { - return null; - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/903e698a/modules/core/src/test/java/org/apache/ignite/util/mbeans/IgniteMXBeanSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/util/mbeans/IgniteMXBeanSelfTest.java b/modules/core/src/test/java/org/apache/ignite/util/mbeans/IgniteMXBeanSelfTest.java new file mode 100644 index 0000000..009112b --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/util/mbeans/IgniteMXBeanSelfTest.java @@ -0,0 +1,345 @@ +/* + * 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.util.mbeans; + +import org.apache.ignite.internal.mxbean.*; +import org.apache.ignite.mxbean.*; +import org.apache.ignite.testframework.junits.common.*; +import javax.management.*; + +/** + * MXBean test. + */ +public class IgniteMXBeanSelfTest extends GridCommonAbstractTest { + /** + * Tests correct MBean interface. + * + * @throws Exception Thrown if test fails. + */ + public void testCorrectMBeanInfo() throws Exception { + StandardMBean mbean = new IgniteStandardMXBean(new IgniteMXBeanImplementation(), IgniteMXBeanInterface.class); + + MBeanInfo info = mbean.getMBeanInfo(); + + assert info.getDescription().equals("MXBeanDescription.") == true; + + assert info.getOperations().length == 2; + + for (MBeanOperationInfo opInfo: info.getOperations()) { + if (opInfo.getDescription().equals("MXBeanOperation.")) + assert opInfo.getSignature().length == 2; + else { + assert opInfo.getDescription().equals("MXBeanSuperOperation.") == true; + assert opInfo.getSignature().length == 1; + } + } + + for (MBeanParameterInfo paramInfo: info.getOperations()[0].getSignature()) { + if (paramInfo.getName().equals("ignored")) + assert paramInfo.getDescription().equals("MXBeanOperationParameter1.") == true; + else { + assert paramInfo.getName().equals("someData") == true; + assert paramInfo.getDescription().equals("MXBeanOperationParameter2.") == true; + } + } + + assert info.getAttributes().length == 4: "Expected 4 attributes but got " + info.getAttributes().length; + + for (MBeanAttributeInfo attrInfo: info.getAttributes()) { + if (attrInfo.isWritable() == false) { + assert (attrInfo.getDescription().equals("MXBeanReadonlyGetter.") == true || + attrInfo.getDescription().equals("MXBeanROGetter.")); + } + else { + assert (attrInfo.getDescription().equals("MXBeanWritableGetter.") == true || + attrInfo.getDescription().equals("MXBeanWritableIsGetter.")); + } + } + } + + /** + * Tests correct MBean interface. + * @throws Exception Thrown if test fails. + */ + public void testMissedNameMBeanInfo() throws Exception { + try { + StandardMBean mbean = new IgniteStandardMXBean(new IgniteMXBeanImplementation(), IgniteMXBeanInterfaceBad.class); + + mbean.getMBeanInfo(); + } + catch (AssertionError e) { + return; + } + + assert false; + } + + /** + * Tests correct MBean interface. + * @throws Exception Thrown if test fails. + */ + public void testMissedDescriptionMBeanInfo() throws Exception { + try { + StandardMBean mbean = new IgniteStandardMXBean(new IgniteMXBeanImplementation(), + IgniteMXBeanInterfaceBadAgain.class); + + mbean.getMBeanInfo(); + } + catch (AssertionError e) { + return; + } + + assert false; + } + + /** + * Tests correct MBean interface. + * @throws Exception Thrown if test fails. + */ + public void testEmptyDescriptionMBeanInfo() throws Exception { + try { + StandardMBean mbean = new IgniteStandardMXBean(new IgniteMXBeanImplementation(), + IgniteMXBeanInterfaceEmptyDescription.class); + + mbean.getMBeanInfo(); + } + catch (AssertionError e) { + return; + } + + assert false; + } + + /** + * Tests correct MBean interface. + * @throws Exception Thrown if test fails. + */ + public void testEmptyNameMBeanInfo() throws Exception { + try { + StandardMBean mbean = new IgniteStandardMXBean(new IgniteMXBeanImplementation(), + IgniteMXBeanInterfaceEmptyName.class); + + mbean.getMBeanInfo(); + } + catch (AssertionError e) { + return; + } + + assert false; + } + + /** + * Super interface for {@link IgniteMXBeanInterface}. + */ + public static interface IgniteMXBeanSuperInterface { + /** + * Test getter. + * + * @return Some string. + */ + @IgniteMXBeanDescription("MXBeanROGetter.") + public String getROData(); + + /** + * Test MBean operation. + * + * @param someData Some data. + * @return Some string. + */ + @IgniteMXBeanDescription("MXBeanSuperOperation.") + @IgniteMXBeanParametersNames({"someData"}) + @IgniteMXBeanParametersDescriptions({"MXBeanOperationParameter1."}) + public String doSomethingSuper(String someData); + } + + /** + * Test MBean interface. + */ + @IgniteMXBeanDescription("MXBeanDescription.") + public static interface IgniteMXBeanInterface extends IgniteMXBeanSuperInterface { + /** + * Test getter. + * + * @return Some string. + */ + @IgniteMXBeanDescription("MXBeanWritableGetter.") + public String getWritableData(); + + /** + * Test setter. + * + * @param data Some string. + */ + public void setWritableData(String data); + + /** + * Test getter. + * + * @return Some string. + */ + @IgniteMXBeanDescription("MXBeanReadonlyGetter.") + public String getReadOnlyData(); + + /** + * Test boolean getter. + * + * @return Some string. + */ + @IgniteMXBeanDescription("MXBeanWritableIsGetter.") + public boolean isWritable(); + + /** + * Test boolean setter. + * @param isWritable Just a boolean. + */ + public void setWritable(boolean isWritable); + + /** + * Test MBean operation. + * + * @param ignored Some value. + * @param someData Some data. + * @return Some string. + */ + @IgniteMXBeanDescription("MXBeanOperation.") + @IgniteMXBeanParametersNames({"ignored", "someData"}) + @IgniteMXBeanParametersDescriptions({"MXBeanOperationParameter1.", "MXBeanOperationParameter2."}) + public String doSomething(boolean ignored, String someData); + } + + /** + * Test MXBean interface. + */ + public static interface IgniteMXBeanInterfaceBad { + /** + * Test MBean operation. + * + * @param ignored Some value. + * @param someData Some data. + * @return Some string. + */ + @IgniteMXBeanDescription("MXBeanOperation.") + @IgniteMXBeanParametersNames({"ignored"}) + @IgniteMXBeanParametersDescriptions({"MXBeanOperationParameter1.", "MXBeanOperationParameter2."}) + public String doSomethingBad(boolean ignored, String someData); + } + + /** + * Test MXBean interface. + */ + public static interface IgniteMXBeanInterfaceEmptyDescription { + /** + * Test MBean operation. + * + * @param ignored Some value. + * @param someData Some data. + * @return Some string. + */ + @IgniteMXBeanDescription("") + public String doSomethingBad(boolean ignored, String someData); + } + + /** + * Test MXBean interface. + */ + public static interface IgniteMXBeanInterfaceEmptyName { + /** + * Test MBean operation. + * + * @param ignored Some value. + * @param someData Some data. + * @return Some string. + */ + @IgniteMXBeanParametersNames({"", "someData"}) + public String doSomethingBadAgain(boolean ignored, String someData); + } + + /** + * Test MXBean interface. + */ + public static interface IgniteMXBeanInterfaceBadAgain { + /** + * Test MBean operation. + * + * @param ignored Some value. + * @param someData Some data. + * @return Some string. + */ + @IgniteMXBeanDescription("MXBeanOperation.") + @IgniteMXBeanParametersNames({"ignored", "someData"}) + @IgniteMXBeanParametersDescriptions({"MXBeanOperationParameter1."}) + public String doSomethingBadAgain(boolean ignored, String someData); + } + + /** + * Test MBean implementation. + */ + public class IgniteMXBeanImplementation implements IgniteMXBeanInterface, IgniteMXBeanInterfaceBad, + IgniteMXBeanInterfaceBadAgain, IgniteMXBeanInterfaceEmptyDescription, IgniteMXBeanInterfaceEmptyName { + + /** {@inheritDoc} */ + @Override public String doSomething(boolean ignored, String someData) { + return null; + } + + /** {@inheritDoc} */ + @Override public String getReadOnlyData() { + return null; + } + + /** {@inheritDoc} */ + @Override public String getWritableData() { + return null; + } + + /** {@inheritDoc} */ + @Override public void setWritableData(String data) { + // No-op. + } + + /** {@inheritDoc} */ + @Override public String doSomethingBad(boolean ignored, String someData) { + return null; + } + + /** {@inheritDoc} */ + @Override public String doSomethingBadAgain(boolean ignored, String someData) { + return null; + } + + /** {@inheritDoc} */ + @Override public boolean isWritable() { + return false; + } + + /** {@inheritDoc} */ + @Override public void setWritable(boolean isWritable) { + // No-op. + } + + /** {@inheritDoc} */ + @Override public String getROData() { + return null; + } + + /** {@inheritDoc} */ + @Override public String doSomethingSuper(String someData) { + return null; + } + } +}