http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/MessageDestinationControlMBean.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/MessageDestinationControlMBean.java b/core/src/flex/management/runtime/messaging/MessageDestinationControlMBean.java new file mode 100644 index 0000000..cbe4492 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/MessageDestinationControlMBean.java @@ -0,0 +1,153 @@ +/* + * 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 flex.management.runtime.messaging; + +import java.io.IOException; +import java.util.Date; + +import javax.management.ObjectName; + + +/** + * Defines the runtime monitoring and management interface for managed + * <code>MessageDestination</code>s. + */ +public interface MessageDestinationControlMBean extends DestinationControlMBean +{ + /** + * Returns the <code>ObjectName</code> for the message cache used by the managed + * destination. + * + * @return The <code>ObjectName</code> for the message cache. + * @throws IOException Throws IOException. + */ + ObjectName getMessageCache() throws IOException; + + /** + * Returns the <code>ObjectName</code> for the throttle manager used by the + * managed destination. + * + * @return The <code>ObjectName</code> for the throttle manager. + * @throws IOException Throws IOException. + */ + ObjectName getThrottleManager() throws IOException; + + /** + * Returns the <code>ObjectName</code> for the subscription manager used + * by the managed destination. + * + * @return The <code>ObjectName</code> for the subscription manager. + * @throws IOException Throws IOException. + */ + ObjectName getSubscriptionManager() throws IOException; + + /** + * Returns the number of service message invocations. + * + * @return The number of service message invocations. + * @throws IOException Throws IOException. + */ + Integer getServiceMessageCount() throws IOException; + + /** + * Resets the count of service message invocations. + * + * @throws IOException Throws IOException. + */ + void resetServiceMessageCount() throws IOException; + + /** + * Returns the timestamp for the most recent service message + * invocation. + * + * @return The timestamp for the most recent service message invocation. + * @throws IOException Throws IOException. + */ + Date getLastServiceMessageTimestamp() throws IOException; + + /** + * Returns the number of service message invocations per minute. + * + * @return The number of service message invocations per minute. + * @throws IOException Throws IOException. + */ + Double getServiceMessageFrequency() throws IOException; + + /** + * Returns the number of service command invocations. + * + * @return The number of service command invocations. + * @throws IOException Throws IOException. + */ + Integer getServiceCommandCount() throws IOException; + + /** + * Resets the count of service command invocations. + * + * @throws IOException Throws IOException. + */ + void resetServiceCommandCount() throws IOException; + + /** + * Returns the timestamp for the most recent service command invocation. + * + * @return The timestamp for the most recent service command invocation. + * @throws IOException Throws IOException. + */ + Date getLastServiceCommandTimestamp() throws IOException; + + /** + * Returns the number of service command invocations per minute. + * + * @return The number of service command invocations per minute. + * @throws IOException Throws IOException. + */ + Double getServiceCommandFrequency() throws IOException; + + /** + * Returns the number of messages from an adapter that the managed service + * has processed. + * + * @return The number of messages from an adapter that the managed service + * has processed + * @throws IOException Throws IOException. + */ + Integer getServiceMessageFromAdapterCount() throws IOException; + + /** + * Resets the count of service message from adapter invocations. + * + * @throws IOException Throws IOException. + */ + void resetServiceMessageFromAdapterCount() throws IOException; + + /** + * Returns the timestamp of the most recent service message from adapter invocation. + * + * @return The timestamp of the most recent service message from adapter invocation. + * @throws IOException Throws IOException. + */ + Date getLastServiceMessageFromAdapterTimestamp() throws IOException; + + /** + * Returns the number of service message from adapter invocations per minute. + * + * @return The number of service message from adapter invocations per minute. + * @throws IOException Throws IOException. + */ + Double getServiceMessageFromAdapterFrequency() throws IOException; +}
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/client/FlexClientManagerControl.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/client/FlexClientManagerControl.java b/core/src/flex/management/runtime/messaging/client/FlexClientManagerControl.java new file mode 100644 index 0000000..273da33 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/client/FlexClientManagerControl.java @@ -0,0 +1,97 @@ +/* + * 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 flex.management.runtime.messaging.client; + +import flex.management.BaseControl; +import flex.management.runtime.AdminConsoleTypes; +import flex.messaging.client.FlexClientManager; + +/** + * + */ +public class FlexClientManagerControl extends BaseControl implements FlexClientManagerControlMBean +{ + private FlexClientManager flexClientManager; + + public FlexClientManagerControl(BaseControl parent, FlexClientManager manager) + { + super(parent); + flexClientManager = manager; + } + + public void onRegistrationComplete() + { + String name = getObjectName().getCanonicalName(); + getRegistrar().registerObject(AdminConsoleTypes.GENERAL_POLLABLE, name, "FlexClientCount"); + } + + /* (non-Javadoc) + * @see flex.management.BaseControl#getId() + */ + public String getId() + { + return flexClientManager.getId(); + } + + /* (non-Javadoc) + * @see flex.management.BaseControl#getType() + */ + public String getType() + { + return flexClientManager.getId(); + } + + /* (non-Javadoc) + * @see flex.management.runtime.messaging.client.FlexClientManagerControlMBean#getClientIds() + */ + public String[] getClientIds() + { + return flexClientManager.getClientIds(); + } + + /* (non-Javadoc) + * @see flex.management.runtime.messaging.client.FlexClientManagerControlMBean#getClientLastUse(java.lang.String) + */ + public Long getClientLastUse(String clientId) + { + return new Long(flexClientManager.getFlexClient(clientId).getLastUse()); + } + + /* (non-Javadoc) + * @see flex.management.runtime.messaging.client.FlexClientManagerControlMBean#getClientSessionCount(java.lang.String) + */ + public Integer getClientSessionCount(String clientId) + { + return new Integer(flexClientManager.getFlexClient(clientId).getSessionCount()); + } + + /* (non-Javadoc) + * @see flex.management.runtime.messaging.client.FlexClientManagerControlMBean#getClientSubscriptionCount(java.lang.String) + */ + public Integer getClientSubscriptionCount(String clientId) + { + return new Integer(flexClientManager.getFlexClient(clientId).getSubscriptionCount()); + } + + /* (non-Javadoc) + * @see flex.management.runtime.messaging.client.FlexClientManagerControlMBean#getFlexClientCount() + */ + public Integer getFlexClientCount() + { + return new Integer(flexClientManager.getFlexClientCount()); + } +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/client/FlexClientManagerControlMBean.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/client/FlexClientManagerControlMBean.java b/core/src/flex/management/runtime/messaging/client/FlexClientManagerControlMBean.java new file mode 100644 index 0000000..f063259 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/client/FlexClientManagerControlMBean.java @@ -0,0 +1,70 @@ +/* + * 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 flex.management.runtime.messaging.client; + +import java.io.IOException; + +import flex.management.BaseControlMBean; + +/** + * Defines the runtime monitoring and management interface for managed flex client managers. + */ +public interface FlexClientManagerControlMBean extends BaseControlMBean +{ + /** + * Returns ids of managed clients. + * + * @return An array of client ids. + * @throws IOException Throws IOException. + */ + String[] getClientIds() throws IOException; + + /** + * Returns the number of subscriptions for the client with the clientId. + * + * @param clientId The client id. + * @return The number of subscriptions for the client with the cliendId + * @throws IOException Throws IOException. + */ + Integer getClientSubscriptionCount(String clientId) throws IOException; + + /** + * Returns the number of sessiosn for the client with the clientId. + * + * @param clientId The client id. + * @return The number of sessions for the client with the cliendId + * @throws IOException Throws IOException. + */ + Integer getClientSessionCount(String clientId) throws IOException; + + /** + * Returns the last use by the client with the clientId. + * + * @param clientId The client id. + * @return The last use by the client with the clientId + * @throws IOException Throws IOException. + */ + Long getClientLastUse(String clientId) throws IOException; + + /** + * Returns the number of clients. + * + * @return The number of clients. + * @throws IOException Throws IOException. + */ + Integer getFlexClientCount() throws IOException; +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/client/package-info.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/client/package-info.java b/core/src/flex/management/runtime/messaging/client/package-info.java new file mode 100644 index 0000000..713b8b3 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/client/package-info.java @@ -0,0 +1,17 @@ +/* + * 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 flex.management.runtime.messaging.client; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/endpoints/AMFEndpointControl.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/endpoints/AMFEndpointControl.java b/core/src/flex/management/runtime/messaging/endpoints/AMFEndpointControl.java new file mode 100644 index 0000000..cd224d4 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/endpoints/AMFEndpointControl.java @@ -0,0 +1,48 @@ +/* + * 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 flex.management.runtime.messaging.endpoints; + +import flex.management.BaseControl; +import flex.messaging.endpoints.AMFEndpoint; + +/** + * The <code>AMFEndpointControl</code> class is the MBean implemenation + * for monitoring and managing an <code>AMFEndpoint</code> at runtime. + */ +public class AMFEndpointControl extends PollingEndpointControl implements + AMFEndpointControlMBean +{ + private static final String TYPE = "AMFEndpoint"; + + /** + * Constructs a <code>AMFEndpointControl</code>, assigning managed message + * endpoint and parent MBean. + * + * @param endpoint The <code>AMFEndpoint</code> managed by this MBean. + * @param parent The parent MBean in the management hierarchy. + */ + public AMFEndpointControl(AMFEndpoint endpoint, BaseControl parent) + { + super(endpoint, parent); + } + + /** {@inheritDoc} */ + public String getType() + { + return TYPE; + } +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/endpoints/AMFEndpointControlMBean.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/endpoints/AMFEndpointControlMBean.java b/core/src/flex/management/runtime/messaging/endpoints/AMFEndpointControlMBean.java new file mode 100644 index 0000000..22c8cc6 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/endpoints/AMFEndpointControlMBean.java @@ -0,0 +1,26 @@ +/* + * 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 flex.management.runtime.messaging.endpoints; + + +/** + * Defines the runtime monitoring and management interface for managed AMF endpoints. + */ +public interface AMFEndpointControlMBean extends PollingEndpointControlMBean +{ + // Empty for now. +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/endpoints/EndpointControl.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/endpoints/EndpointControl.java b/core/src/flex/management/runtime/messaging/endpoints/EndpointControl.java new file mode 100644 index 0000000..f6bbfb6 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/endpoints/EndpointControl.java @@ -0,0 +1,239 @@ +/* + * 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 flex.management.runtime.messaging.endpoints; + +import flex.management.BaseControl; +import flex.management.runtime.AdminConsoleTypes; +import flex.management.runtime.messaging.MessageBrokerControl; +import flex.messaging.config.SecurityConstraint; +import flex.messaging.endpoints.Endpoint; + +import java.util.Date; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +/** + * The <code>EndpointControl</code> class is the MBean implementation for + * monitoring and managing an <code>Endpoint</code> at runtime. + */ +public abstract class EndpointControl extends BaseControl implements EndpointControlMBean +{ + protected Endpoint endpoint; + private AtomicInteger serviceMessageCount = new AtomicInteger(0); + private Date lastServiceMessageTimestamp; + private long serviceMessageStart; + private AtomicLong bytesDeserialized = new AtomicLong(0); + private AtomicLong bytesSerialized = new AtomicLong(0); + + /** + * Constructs an <code>EndpointControl</code>, assigning its managed endpoint and + * parent MBean. + * + * @param endpoint The <code>Endpoint</code> managed by this MBean. + * @param parent The parent MBean in the management hierarchy. + */ + public EndpointControl(Endpoint endpoint, BaseControl parent) + { + super(parent); + this.endpoint = endpoint; + serviceMessageStart = System.currentTimeMillis(); + } + + + protected void onRegistrationComplete() + { + String name = this.getObjectName().getCanonicalName(); + String[] generalNames = { "SecurityConstraint"}; + String[] generalPollables = { "ServiceMessageCount", "LastServiceMessageTimestamp", "ServiceMessageFrequency"}; + String[] pollableGraphByInterval = {"BytesDeserialized", "BytesSerialized"}; + + getRegistrar().registerObjects(AdminConsoleTypes.ENDPOINT_SCALAR, + name, generalNames); + getRegistrar().registerObjects(AdminConsoleTypes.ENDPOINT_POLLABLE, + name, generalPollables); + getRegistrar().registerObjects(new int[] {AdminConsoleTypes.GRAPH_BY_POLL_INTERVAL, AdminConsoleTypes.ENDPOINT_POLLABLE}, + name, pollableGraphByInterval); + } + + /* + * (non-Javadoc) + * @see flex.management.BaseControlMBean#getId() + */ + public String getId() + { + return endpoint.getId(); + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.EndpointControlMBean#isRunning() + */ + public Boolean isRunning() + { + return Boolean.valueOf(endpoint.isStarted()); + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.EndpointControlMBean#getStartTimestamp() + */ + public Date getStartTimestamp() + { + return startTimestamp; + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.EndpointControlMBean#getServiceMessageCount() + */ + public Integer getServiceMessageCount() + { + return Integer.valueOf(serviceMessageCount.get()); + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.EndpointControlMBean#resetServiceMessageCount() + */ + public void resetServiceMessageCount() + { + serviceMessageStart = System.currentTimeMillis(); + serviceMessageCount = new AtomicInteger(0); + lastServiceMessageTimestamp = null; + } + + /** + * Increments the count of <code>serviceMessage()</code> invocations by the endpoint. + */ + public void incrementServiceMessageCount() + { + serviceMessageCount.incrementAndGet(); + lastServiceMessageTimestamp = new Date(); + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.EndpointControlMBean#getLastServiceMessageTimestamp() + */ + public Date getLastServiceMessageTimestamp() + { + return lastServiceMessageTimestamp; + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.EndpointControlMBean#getServiceMessageFrequency() + */ + public Double getServiceMessageFrequency() + { + if (serviceMessageCount.get() > 0) + { + double runtime = differenceInMinutes(serviceMessageStart, System.currentTimeMillis()); + return new Double(serviceMessageCount.get()/runtime); + } + else + { + return new Double(0); + } + } + + /* + * (non-Javadoc) + * @see javax.management.MBeanRegistration#preDeregister() + */ + public void preDeregister() throws Exception + { + MessageBrokerControl parent = (MessageBrokerControl)getParentControl(); + parent.removeEndpoint(getObjectName()); + } + + public String getURI() + { + return endpoint.getUrl(); + } + + public String getSecurityConstraint() + { + return getSecurityConstraintOf(endpoint); + } + + public static String getSecurityConstraintOf(Endpoint endpoint) + { + String result = "None"; + + SecurityConstraint constraint = endpoint.getSecurityConstraint(); + if (constraint != null) + { + String authMethod = constraint.getMethod(); + if (authMethod != null) + { + StringBuffer buffer = new StringBuffer(); + buffer.append(authMethod); + + List roles = constraint.getRoles(); + if ((roles != null) && !roles.isEmpty()) + { + buffer.append(':'); + for (int i = 0; i < roles.size(); i++) + { + if (i > 0) + { + buffer.append(','); + } + buffer.append(' '); + buffer.append(roles.get(i)); + } + } + result = buffer.toString(); + } + } + return result; + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.EndpointControlMBean#getBytesDeserialized() + */ + public Long getBytesDeserialized(){ + return Long.valueOf(bytesDeserialized.get()); + } + + /** + * Increments the count of bytes deserialized by the endpoint. + * @param currentBytesDeserialized the bytes is deserialized + */ + public void addToBytesDeserialized(int currentBytesDeserialized) { + bytesDeserialized.addAndGet(currentBytesDeserialized); + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.EndpointControlMBean#getBytesSerialized() + */ + public Long getBytesSerialized() { + return Long.valueOf(bytesSerialized.get()); + } + + /** + * Increments the count of bytes serialized by the endpoint. + * @param currentBytesSerialized the bytes is serialized + */ + public void addToBytesSerialized(int currentBytesSerialized) { + bytesSerialized.addAndGet(currentBytesSerialized); + } +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/endpoints/EndpointControlMBean.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/endpoints/EndpointControlMBean.java b/core/src/flex/management/runtime/messaging/endpoints/EndpointControlMBean.java new file mode 100644 index 0000000..48844a3 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/endpoints/EndpointControlMBean.java @@ -0,0 +1,111 @@ +/* + * 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 flex.management.runtime.messaging.endpoints; + +import flex.management.BaseControlMBean; + +import java.io.IOException; +import java.util.Date; + +/** + * Defines the runtime monitoring and management interface for managed endpoints. + */ +public interface EndpointControlMBean extends BaseControlMBean +{ + /** + * Returns <code>true</code> if the <code>Endpoint</code> is running. + * + * @return <code>true</code> if the <code>Endpoint</code> is running. + * @throws IOException Throws IOException. + */ + Boolean isRunning() throws IOException; + + /** + * Returns the start timestamp for the <code>Endpoint</code>. + * + * @return The start timestamp for the <code>Endpoint</code>. + * @throws IOException Throws IOException. + */ + Date getStartTimestamp() throws IOException; + + /** + * Returns the count of messages decoded by this endpoint and routed to the broker. + * + * @return The count of messages decoded by this endpoint and routed to the broker. + * @throws IOException Throws IOException. + */ + Integer getServiceMessageCount() throws IOException; + + /** + * Resets the count of service message invocations. + * + * @throws IOException Throws IOException. + */ + void resetServiceMessageCount() throws IOException; + + /** + * Returns the timestamp for the most recent message decoded by this endpoint and + * routed to the broker. + * + * @return The timestamp for the most recent message decoded by this endpoint and + * routed to the broker. + * @throws IOException Throws IOException. + */ + Date getLastServiceMessageTimestamp() throws IOException; + + /** + * Returns the number of service message invocations per minute. + * + * @return The number of service message invocations per minute. + * @throws IOException Throws IOException. + */ + Double getServiceMessageFrequency() throws IOException; + + /** + * Returns the URI that corresponds to this endpoint. + * + * @return The URI that corresponds to this endpoint. + * @throws IOException Throws IOException. + */ + String getURI() throws IOException; + + /** + * Returns the security constraint that is associated with this endpoint. + * + * @return The security constraint that is associated with this endpoint. + * @throws IOException Throws IOException. + */ + String getSecurityConstraint() throws IOException; + + /** + * Returns the total Bytes that have been deserialized by this endpoint + * during its lifetime. + * + * @return total Bytes deserialized. + * @throws IOException Throws IOException. + */ + Long getBytesDeserialized() throws IOException; + + /** + * Returns the total Bytes that have been serialized by this endpoint + * during its lifetime. + * + * @return total Bytes serialized. + * @throws IOException Throws IOException. + */ + Long getBytesSerialized() throws IOException; +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/endpoints/HTTPEndpointControl.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/endpoints/HTTPEndpointControl.java b/core/src/flex/management/runtime/messaging/endpoints/HTTPEndpointControl.java new file mode 100644 index 0000000..e0daf9a --- /dev/null +++ b/core/src/flex/management/runtime/messaging/endpoints/HTTPEndpointControl.java @@ -0,0 +1,48 @@ +/* + * 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 flex.management.runtime.messaging.endpoints; + +import flex.management.BaseControl; +import flex.messaging.endpoints.HTTPEndpoint; + +/** + * The <code>HTTPEndpointControl</code> class is the MBean implemenation + * for monitoring and managing a <code>HTTPEndpoint</code> at runtime. + */ +public class HTTPEndpointControl extends PollingEndpointControl implements + HTTPEndpointControlMBean +{ + private static final String TYPE = "HTTPEndpoint"; + + /** + * Constructs a <code>HTTPEndpointControl</code>, assigning managed message + * endpoint and parent MBean. + * + * @param endpoint The <code>HTTPEndpoint</code> managed by this MBean. + * @param parent The parent MBean in the management hierarchy. + */ + public HTTPEndpointControl(HTTPEndpoint endpoint, BaseControl parent) + { + super(endpoint, parent); + } + + /** {@inheritDoc} */ + public String getType() + { + return TYPE; + } +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/endpoints/HTTPEndpointControlMBean.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/endpoints/HTTPEndpointControlMBean.java b/core/src/flex/management/runtime/messaging/endpoints/HTTPEndpointControlMBean.java new file mode 100644 index 0000000..7d4f8e7 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/endpoints/HTTPEndpointControlMBean.java @@ -0,0 +1,25 @@ +/* + * 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 flex.management.runtime.messaging.endpoints; + +/** + * Defines the runtime monitoring and management interface for managed HTTP endpoints. + */ +public interface HTTPEndpointControlMBean extends PollingEndpointControlMBean +{ + // Empty for now. +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/endpoints/PollingEndpointControl.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/endpoints/PollingEndpointControl.java b/core/src/flex/management/runtime/messaging/endpoints/PollingEndpointControl.java new file mode 100644 index 0000000..de4db0f --- /dev/null +++ b/core/src/flex/management/runtime/messaging/endpoints/PollingEndpointControl.java @@ -0,0 +1,72 @@ +/* + * 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 flex.management.runtime.messaging.endpoints; + +import flex.management.BaseControl; +import flex.management.runtime.AdminConsoleTypes; +import flex.messaging.endpoints.BasePollingHTTPEndpoint; + +/** + * The <tt>PollingEndpointControl</tt> class is the base MBean implementation + * for monitoring and managing a <tt>BasePollingHTTPEndpoint</tt> at runtime. + */ +public abstract class PollingEndpointControl extends EndpointControl implements + PollingEndpointControlMBean +{ + /** + * Constructs a <tt>PollingEndpointControl</tt>, assigning managed message + * endpoint and parent MBean. + * + * @param endpoint The <code>BasePollingHTTPEndpoint</code> managed by this MBean. + * @param parent The parent MBean in the management hierarchy. + */ + public PollingEndpointControl(BasePollingHTTPEndpoint endpoint, BaseControl parent) + { + super(endpoint, parent); + } + + protected void onRegistrationComplete() + { + super.onRegistrationComplete(); + + String name = this.getObjectName().getCanonicalName(); + String[] generalPollables = {"WaitingPollRequestsCount"}; + + getRegistrar().registerObjects(AdminConsoleTypes.ENDPOINT_POLLABLE, name, generalPollables); + getRegistrar().registerObject(AdminConsoleTypes.ENDPOINT_SCALAR, name, "MaxWaitingPollRequests"); + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.messaging.endpoints.PollingEndpointControlMBean#getMaxWaitingPollRequests() + */ + public Integer getMaxWaitingPollRequests() + { + int maxWaitingPollRequests = ((BasePollingHTTPEndpoint)endpoint).getMaxWaitingPollRequests(); + return new Integer(maxWaitingPollRequests); + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.messaging.endpoints.PollingEndpointControlMBean#getWaitingPollRequestsCount() + */ + public Integer getWaitingPollRequestsCount() + { + int waitingPollRequestsCount = ((BasePollingHTTPEndpoint)endpoint).getWaitingPollRequestsCount(); + return new Integer(waitingPollRequestsCount); + } +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/endpoints/PollingEndpointControlMBean.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/endpoints/PollingEndpointControlMBean.java b/core/src/flex/management/runtime/messaging/endpoints/PollingEndpointControlMBean.java new file mode 100644 index 0000000..2c30b49 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/endpoints/PollingEndpointControlMBean.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 flex.management.runtime.messaging.endpoints; + +import java.io.IOException; + +/** + * Defines the runtime monitoring and management interface for managed polling + * endpoints. + */ +public interface PollingEndpointControlMBean extends EndpointControlMBean +{ + /** + * Returns the maximum number of server poll response threads that will be + * waiting for messages to arrive for clients. + * + * @return The maximum number of server poll response threads that will be + * waiting for messages to arrive for clients. + * @throws IOException Throws IOException. + */ + Integer getMaxWaitingPollRequests() throws IOException; + + /** + * Returns the number of request threads that are currently in the wait state + * (including those on their way into or out of it). + * + * @return The number of request threads that are currently in the wait state. + * @throws IOException Throws IOException. + */ + Integer getWaitingPollRequestsCount() throws IOException; +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/endpoints/StreamingAMFEndpointControl.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/endpoints/StreamingAMFEndpointControl.java b/core/src/flex/management/runtime/messaging/endpoints/StreamingAMFEndpointControl.java new file mode 100644 index 0000000..00d7022 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/endpoints/StreamingAMFEndpointControl.java @@ -0,0 +1,48 @@ +/* + * 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 flex.management.runtime.messaging.endpoints; + +import flex.management.BaseControl; +import flex.messaging.endpoints.StreamingAMFEndpoint; + +/** + * The <code>StreamingAMFEndpointControl</code> class is the MBean implemenation + * for monitoring and managing an <code>StreamingAMFEndpoint</code> at runtime. + */ +public class StreamingAMFEndpointControl extends StreamingEndpointControl implements + StreamingAMFEndpointControlMBean +{ + private static final String TYPE = "StreamingAMFEndpoint"; + + /** + * Constructs a <code>StreamingAMFEndpointControl</code>, assigning managed message + * endpoint and parent MBean. + * + * @param endpoint The <code>StreamingAMFEndpoint</code> managed by this MBean. + * @param parent The parent MBean in the management hierarchy. + */ + public StreamingAMFEndpointControl(StreamingAMFEndpoint endpoint, BaseControl parent) + { + super(endpoint, parent); + } + + /** {@inheritDoc} */ + public String getType() + { + return TYPE; + } +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/endpoints/StreamingAMFEndpointControlMBean.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/endpoints/StreamingAMFEndpointControlMBean.java b/core/src/flex/management/runtime/messaging/endpoints/StreamingAMFEndpointControlMBean.java new file mode 100644 index 0000000..32d05b9 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/endpoints/StreamingAMFEndpointControlMBean.java @@ -0,0 +1,26 @@ +/* + * 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 flex.management.runtime.messaging.endpoints; + +/** + * Defines the runtime monitoring and management interface for managed streaming + * AMF endpoints. + */ +public interface StreamingAMFEndpointControlMBean extends StreamingEndpointControlMBean +{ + // Empty for now +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/endpoints/StreamingEndpointControl.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/endpoints/StreamingEndpointControl.java b/core/src/flex/management/runtime/messaging/endpoints/StreamingEndpointControl.java new file mode 100644 index 0000000..b3cdc64 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/endpoints/StreamingEndpointControl.java @@ -0,0 +1,133 @@ +/* + * 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 flex.management.runtime.messaging.endpoints; + +import java.util.Date; + +import flex.management.BaseControl; +import flex.management.runtime.AdminConsoleTypes; +import flex.messaging.endpoints.BaseStreamingHTTPEndpoint; + +/** + * The <code>StreamingEndpointControl</code> class is the base MBean implementation + * for monitoring and managing a <code>BaseStreamingHTTPEndpoint</code> at runtime. + */ +public abstract class StreamingEndpointControl extends EndpointControl implements + StreamingEndpointControlMBean +{ + private int pushCount; + private Date lastPushTimeStamp; + private long pushStart; + + /** + * Constructs a <code>StreamingEndpointControl</code>, assigning managed message + * endpoint and parent MBean. + * + * @param endpoint The <code>BaseStreamingHTTPEndpoint</code> managed by this MBean. + * @param parent The parent MBean in the management hierarchy. + */ + public StreamingEndpointControl(BaseStreamingHTTPEndpoint endpoint, BaseControl parent) + { + super(endpoint, parent); + } + + protected void onRegistrationComplete() + { + super.onRegistrationComplete(); + + String name = this.getObjectName().getCanonicalName(); + String[] generalPollables = { "LastPushTimestamp", "PushCount", "PushFrequency", "StreamingClientsCount"}; + + getRegistrar().registerObjects(AdminConsoleTypes.ENDPOINT_POLLABLE, name, generalPollables); + getRegistrar().registerObject(AdminConsoleTypes.ENDPOINT_SCALAR, name, "MaxStreamingClients"); + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.messaging.endpoints.StreamingEndpointControlMBean#getMaxStreamingClients() + */ + public Integer getMaxStreamingClients() + { + int maxStreamingClientsCount = ((BaseStreamingHTTPEndpoint)endpoint).getMaxStreamingClients(); + return new Integer(maxStreamingClientsCount); + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.messaging.endpoints.StreamingEndpointControlMBean#getPushCount() + */ + public Integer getPushCount() + { + return new Integer(pushCount); + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.messaging.endpoints.StreamingEndpointControlMBean#resetPushCount() + */ + public void resetPushCount() + { + pushStart = System.currentTimeMillis(); + pushCount = 0; + lastPushTimeStamp = null; + } + + /** + * Increments the count of messages pushed by the endpoint. + */ + public void incrementPushCount() + { + ++pushCount; + lastPushTimeStamp = new Date(); + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.messaging.endpoints.StreamingEndpointControlMBean#getLastPushTimestamp() + */ + public Date getLastPushTimestamp() + { + return lastPushTimeStamp; + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.messaging.endpoints.StreamingEndpointControlMBean#getPushFrequency() + */ + public Double getPushFrequency() + { + if (pushCount > 0) + { + double runtime = differenceInMinutes(pushStart, System.currentTimeMillis()); + return new Double(pushCount/runtime); + } + else + { + return new Double(0); + } + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.messaging.endpoints.StreamingEndpointControlMBean#isRunning() + */ + public Integer getStreamingClientsCount() + { + int streamingClientsCount = ((BaseStreamingHTTPEndpoint)endpoint).getStreamingClientsCount(); + return new Integer(streamingClientsCount); + } +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/endpoints/StreamingEndpointControlMBean.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/endpoints/StreamingEndpointControlMBean.java b/core/src/flex/management/runtime/messaging/endpoints/StreamingEndpointControlMBean.java new file mode 100644 index 0000000..b8c684e --- /dev/null +++ b/core/src/flex/management/runtime/messaging/endpoints/StreamingEndpointControlMBean.java @@ -0,0 +1,76 @@ +/* + * 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 flex.management.runtime.messaging.endpoints; + +import java.io.IOException; +import java.util.Date; + +/** + * Defines the runtime monitoring and management interface for managed streaming + * endpoints. + */ +public interface StreamingEndpointControlMBean extends EndpointControlMBean +{ + /** + * Returns the maximum number of clients that will be allowed to establish + * a streaming HTTP connection with the endpoint. + * + * @return The maximum number of clients that will be allowed to establish + * a streaming HTTP connection with the endpoint. + * @throws IOException Throws IOException. + */ + Integer getMaxStreamingClients() throws IOException; + + /** + * Returns the count of push invocations. + * + * @return The count of push invocations. + * @throws IOException Throws IOException. + */ + Integer getPushCount() throws IOException; + + /** + * Resets the count of push invocations. + * + * @throws IOException Throws IOException. + */ + void resetPushCount() throws IOException; + + /** + * Returns the timestamp for the most recent push invocation. + * + * @return The timestamp for the most recent push invocation. + * @throws IOException Throws IOException. + */ + Date getLastPushTimestamp() throws IOException; + + /** + * Returns the number of push invocations per minute. + * + * @return The number of push invocations per minute. + * @throws IOException Throws IOException. + */ + Double getPushFrequency() throws IOException; + + /** + * Returns the the number of clients that are currently in the streaming state. + * + * @return The number of clients that are currently in the streaming state. + * @throws IOException Throws IOException. + */ + Integer getStreamingClientsCount() throws IOException; +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/endpoints/StreamingHTTPEndpointControl.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/endpoints/StreamingHTTPEndpointControl.java b/core/src/flex/management/runtime/messaging/endpoints/StreamingHTTPEndpointControl.java new file mode 100644 index 0000000..a103b95 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/endpoints/StreamingHTTPEndpointControl.java @@ -0,0 +1,48 @@ +/* + * 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 flex.management.runtime.messaging.endpoints; + +import flex.management.BaseControl; +import flex.messaging.endpoints.StreamingHTTPEndpoint; + +/** + * The <code>StreamingHTTPEndpointControl</code> class is the MBean implemenation + * for monitoring and managing a <code>StreamingHTTPEndpoint</code> at runtime. + */ +public class StreamingHTTPEndpointControl extends StreamingEndpointControl implements + StreamingHTTPEndpointControlMBean +{ + private static final String TYPE = "StreamingHTTPEndpoint"; + + /** + * Constructs a <code>StreamingHTTPEndpointControl</code>, assigning managed message + * endpoint and parent MBean. + * + * @param endpoint The <code>StreamingHTTPEndpoint</code> managed by this MBean. + * @param parent The parent MBean in the management hierarchy. + */ + public StreamingHTTPEndpointControl(StreamingHTTPEndpoint endpoint, BaseControl parent) + { + super(endpoint, parent); + } + + /** {@inheritDoc} */ + public String getType() + { + return TYPE; + } +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/endpoints/StreamingHTTPEndpointControlMBean.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/endpoints/StreamingHTTPEndpointControlMBean.java b/core/src/flex/management/runtime/messaging/endpoints/StreamingHTTPEndpointControlMBean.java new file mode 100644 index 0000000..f17cb85 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/endpoints/StreamingHTTPEndpointControlMBean.java @@ -0,0 +1,26 @@ +/* + * 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 flex.management.runtime.messaging.endpoints; + +/** + * Defines the runtime monitoring and management interface for managed streaming + * HTTP endpoints. + */ +public interface StreamingHTTPEndpointControlMBean extends StreamingEndpointControlMBean +{ + // Empty for now +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/endpoints/package-info.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/endpoints/package-info.java b/core/src/flex/management/runtime/messaging/endpoints/package-info.java new file mode 100644 index 0000000..0936f70 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/endpoints/package-info.java @@ -0,0 +1,17 @@ +/* + * 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 flex.management.runtime.messaging.endpoints; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/log/LogControl.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/log/LogControl.java b/core/src/flex/management/runtime/messaging/log/LogControl.java new file mode 100644 index 0000000..d0b5843 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/log/LogControl.java @@ -0,0 +1,147 @@ +/* + * 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 flex.management.runtime.messaging.log; + +import flex.management.BaseControl; +import flex.messaging.log.AbstractTarget; +import flex.messaging.log.Log; +import flex.messaging.log.Target; + +/** + * The <code>LogControl</code> class is the MBean implemenation + * for monitoring and managing a <code>Log</code> at runtime through the <code>LogManager</code>. + */ +public class LogControl extends BaseControl implements + LogControlMBean +{ + + private static final String TYPE = "Log"; // The type registered with the mbean server + private LogManager logManager; // Reference to the LogManager which interfaces with Log + + + /** + * Creates the mbean and registers it with the mbean server. + * + * @param parent BaseControl + * @param manager A reference to the LogManager + */ + public LogControl(BaseControl parent, LogManager manager) + { + super(parent); + this.logManager = manager; + register(); + } + + + /** + * Sets the logging level for the target associated with the unique ID searchId. + * @param searchId the search ID + * @param level the log level + */ + public void changeTargetLevel(String searchId, String level) + { + Target selectedTarget = Log.getTarget(searchId); + if (selectedTarget != null) + { + selectedTarget.setLevel(new Short(level).shortValue()); + } + } + + /* (non-Javadoc) + * @see flex.management.BaseControl#getId() + */ + public String getId() + { + return logManager.getId(); + } + + /* (non-Javadoc) + * @see flex.management.BaseControl#getType() + */ + public String getType() + { + return TYPE; + } + + /** + * Return a string array of the loggers. + * @return a string array of loggers + */ + public String[] getLoggers() + { + return logManager.getLoggers(); + } + + /* (non-Javadoc) + * @see flex.management.runtime.messaging.log.LogControlMBean#getTargets() + */ + public String[] getTargets() + { + return logManager.getTargetIds(); + } + + /* (non-Javadoc) + * @see flex.management.runtime.messaging.log.LogControlMBean#addFilterForTarget(java.lang.String, java.lang.String) + */ + public void addFilterForTarget(String targetId, String filter) + { + AbstractTarget target = (AbstractTarget) logManager.getTarget(targetId); + + if (target != null && logManager.checkFilter(filter)) + target.addFilter(filter); + } + + /* (non-Javadoc) + * @see flex.management.runtime.messaging.log.LogControlMBean#getTargetFilters(java.lang.String) + */ + public String[] getTargetFilters(String targetId) + { + return logManager.getTargetFilters(targetId); + } + + /* (non-Javadoc) + * @see flex.management.runtime.messaging.log.LogControlMBean#removeFilterForTarget(java.lang.String, java.lang.String) + */ + public void removeFilterForTarget(String targetId, String filter) + { + AbstractTarget target = (AbstractTarget) logManager.getTarget(targetId); + + if (target != null && target.containsFilter(filter)) + target.removeFilter(filter); + } + + /* (non-Javadoc) + * @see flex.management.runtime.messaging.log.LogControlMBean#getCategories() + */ + public String[] getCategories() + { + return (String[]) logManager.getCategories().toArray(new String[0]); + } + + + public Integer getTargetLevel(String searchId) + { + AbstractTarget target = (AbstractTarget) logManager.getTarget(searchId); + + if (target != null) + { + return new Integer(target.getLevel()); + } else + return new Integer(-1); + } + +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/log/LogControlMBean.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/log/LogControlMBean.java b/core/src/flex/management/runtime/messaging/log/LogControlMBean.java new file mode 100644 index 0000000..762c895 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/log/LogControlMBean.java @@ -0,0 +1,80 @@ +/* + * 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 flex.management.runtime.messaging.log; + +import flex.management.BaseControlMBean; + + +/** + * Defines the exposed properties and operations of the LogControl. + */ +public interface LogControlMBean extends BaseControlMBean +{ + /** + * Returns the array of log targets. + * + * @return The array of log targets. + */ + String[] getTargets(); + + /** + * Returns the array of log target filters. + * + * @param targetId The target id. + * @return The array of log target filters. + */ + String[] getTargetFilters(String targetId); + + /** + * Returns the array of log categories. + * + * @return The array of log categories. + */ + String[] getCategories(); + + /** + * Returns the target level. + * + * @param targetId The target id. + * @return The target level. + */ + Integer getTargetLevel(String targetId); + + /** + * Changes the target level. + * + * @param targetId The target id. + * @param level The target level. + */ + void changeTargetLevel(String targetId, String level); + + /** + * Adds a filter for the target. + * + * @param filter The filter. + * @param targetId The target id. + */ + void addFilterForTarget(String filter, String targetId); + + /** + * Removes a filter from the target. + * + * @param filter The filter. + * @param targetId The target id. + */ + void removeFilterForTarget(String filter, String targetId); +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/log/LogManager.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/log/LogManager.java b/core/src/flex/management/runtime/messaging/log/LogManager.java new file mode 100644 index 0000000..b9c63b5 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/log/LogManager.java @@ -0,0 +1,260 @@ +/* + * 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 flex.management.runtime.messaging.log; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.lang.reflect.Field; + +import flex.management.ManageableComponent; +import flex.messaging.config.ConfigurationException; +import flex.messaging.log.Log; +import flex.messaging.log.LogCategories; +import flex.messaging.log.Target; + + +/** + * The LogManager is an interface between the Log and the LogControl which exists + * because Log lives in the common package, so it cannot extend ManageableComponent itself, + * which is necessary for a class to be exposed through MBeans. + */ +public class LogManager extends ManageableComponent +{ + + private static final String LOG_CATEGORY = LogCategories.CONFIGURATION; // Log category used by LogManager (ManageableComponent) + private static final int NULL_LOG_REF_EXCEPTION = 10031; + + private Log log; + private String ID = "log"; + private CategoryManager categoryManager; + private LogControl controller; + + private boolean isSetup; + + /** + * Public constructor required by ManageableComponent. + */ + public LogManager() + { + this(true); + } + + public LogManager(boolean enableManagement) + { + super(enableManagement); + setId(ID); + + categoryManager = new CategoryManager(); + + } + + + public void setupLogControl() + { + if (!isSetup) + { + controller = new LogControl(getParent().getControl(), this); + setControl(controller); + controller.register(); + isSetup = true; + } + } + + public void stop() + { + if (!isStarted()) + { + return; + } + + + super.stop(); + + // Remove management + if (isManaged()) + { + if (getControl() != null) + { + getControl().unregister(); + setControl(null); + } + setManaged(false); + } + } + + public void setLog(Log logInstance) + { + log = logInstance; + } + + /* (non-Javadoc) + * @see flex.management.ManageableComponent#getLogCategory() + */ + protected String getLogCategory() + { + return LOG_CATEGORY; + } + + /** + * Gets the Loggers as a string array. + * @return a String array + */ + public String[] getLoggers() + { + return log.getLoggers(); + } + + /** + * Gets the Target IDs. + * @return a string array + */ + public String[] getTargetIds() + { + return (String[]) Log.getTargetMap().keySet().toArray(new String[0]); + } + + /** + * Get a Target for a targetId. + * + * @param targetId the target ID + * @return the target from the Log, or null if it is not found + */ + public Target getTarget(String targetId) + { + return (Target) Log.getTargetMap().get(targetId); + } + + /** + * Gets the filters for a given target. + * @param targetId the target ID + * @return a string array + */ + public String[] getTargetFilters(String targetId) + { + + Target target = getTarget(targetId); + + if (target == null) + return new String[0]; + + List filterObjects = target.getFilters(); + String[] filters = new String[filterObjects.size()]; + for (int i = 0; i < filterObjects.size(); i++) + { + filters[i] = (String)filterObjects.get(i); + } + + return filters; + } + + /** + * Check whether a filter is valid. + * @param filter the filter string to check + * @return whether the category exists in LogCategories + */ + public boolean checkFilter(String filter) + { + return categoryManager.checkFilter(filter); + } + + /** + * Return a list of categories in LogCategories. + * @return the list of categories in LogCategories + */ + public List getCategories() + { + return categoryManager.getCategories(); + } + + protected void validate() + { + if (isValid()) + return; + + super.validate(); + + if (log == null) + { + invalidate(); + ConfigurationException ex = new ConfigurationException(); + ex.setMessage(NULL_LOG_REF_EXCEPTION, new Object[]{}); + throw ex; + } + + } + + /** + * This private class keeps track of what categories exist in LogCategories by implementing + * LogCategories and reflecting the interface's properties. + */ + private class CategoryManager implements LogCategories + { + private List categories; + + /** + * Construct an ArrayList for each category in the reflected public properties + * Note this will be incorrect if additional public properties are added to this class + * or to the interface LogCategories. + */ + public CategoryManager() + { + categories = new ArrayList(); + + Field[] categoryFields = this.getClass().getFields(); + for (int i = 0; i < categoryFields.length; i++) + { + try + { + categories.add((String)categoryFields[i].get(this)); + } + catch (IllegalAccessException iae) + { + // Illegal Access on reflection + } + } + } + + + /** + * Check if any categories match with the filter (the filter is valid or not). + * @param filter the filter string to check + * @return whether the filter is valid (with or without a trailing .*) + */ + public boolean checkFilter(String filter) + { + + for (int i = 0; i < categories.size(); i++) + { + if (Log.checkFilterToCategory((String)filter, (String)categories.get(i))) + { + return true; + } + } + return false; + } + + /** + * Return a list of log categories. + * @return List a list of the categories + */ + public List getCategories() + { + return Collections.unmodifiableList(new ArrayList(categories)); + } + } +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/log/package-info.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/log/package-info.java b/core/src/flex/management/runtime/messaging/log/package-info.java new file mode 100644 index 0000000..a3e940b --- /dev/null +++ b/core/src/flex/management/runtime/messaging/log/package-info.java @@ -0,0 +1,18 @@ +/* + * 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 flex.management.runtime.messaging.log; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/package-info.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/package-info.java b/core/src/flex/management/runtime/messaging/package-info.java new file mode 100644 index 0000000..c87a5f5 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/package-info.java @@ -0,0 +1,17 @@ +/* + * 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 flex.management.runtime.messaging; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/services/MessageServiceControl.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/services/MessageServiceControl.java b/core/src/flex/management/runtime/messaging/services/MessageServiceControl.java new file mode 100644 index 0000000..99e0e85 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/services/MessageServiceControl.java @@ -0,0 +1,49 @@ +/* + * 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 flex.management.runtime.messaging.services; + +import flex.management.BaseControl; +import flex.messaging.services.MessageService; + +/** + * The <code>MessageServiceControl</code> class is the MBean implemenation + * for monitoring and managing a <code>MessageService</code> at runtime. + */ +public class MessageServiceControl extends ServiceControl implements + MessageServiceControlMBean +{ + private static final String TYPE = "MessageService"; + + /** + * Constructs a <code>MessageServiceControl</code>, assigning its id, managed + * message service and parent MBean. + * + * @param service The <code>MessageService</code> managed by this MBean. + * @param parent The parent MBean in the management hierarchy. + */ + public MessageServiceControl(MessageService service, BaseControl parent) + { + super(service, parent); + } + + /** {@inheritDoc} */ + public String getType() + { + return TYPE; + } + +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/services/MessageServiceControlMBean.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/services/MessageServiceControlMBean.java b/core/src/flex/management/runtime/messaging/services/MessageServiceControlMBean.java new file mode 100644 index 0000000..72ac1c8 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/services/MessageServiceControlMBean.java @@ -0,0 +1,26 @@ +/* + * 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 flex.management.runtime.messaging.services; + + +/** + * Defines the runtime monitoring and management interface for managed message services. + */ +public interface MessageServiceControlMBean extends ServiceControlMBean +{ + // Empty for now. +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/services/ServiceAdapterControl.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/services/ServiceAdapterControl.java b/core/src/flex/management/runtime/messaging/services/ServiceAdapterControl.java new file mode 100644 index 0000000..69c99e7 --- /dev/null +++ b/core/src/flex/management/runtime/messaging/services/ServiceAdapterControl.java @@ -0,0 +1,85 @@ +/* + * 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 flex.management.runtime.messaging.services; + +import java.util.Date; + +import flex.management.BaseControl; +import flex.management.runtime.messaging.DestinationControl; +import flex.messaging.services.ServiceAdapter; + +/** + * The <code>ServiceAdapterControl</code> class is the base MBean implementation + * for monitoring and managing a <code>ServiceAdapter</code> at runtime. + */ +public abstract class ServiceAdapterControl extends BaseControl implements + ServiceAdapterControlMBean +{ + protected ServiceAdapter serviceAdapter; + + /** + * Constructs a <code>ServiceAdapterControl</code>, assigning its id, managed service + * adapter and parent MBean. + * + * @param serviceAdapter The <code>ServiceAdapter</code> managed by this MBean. + * @param parent The parent MBean in the management hierarchy. + */ + public ServiceAdapterControl(ServiceAdapter serviceAdapter, BaseControl parent) + { + super(parent); + this.serviceAdapter = serviceAdapter; + } + + /* + * (non-Javadoc) + * @see flex.management.BaseControlMBean#getId() + */ + public String getId() + { + return serviceAdapter.getId(); + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.ServiceAdapterControlMBean#isRunning() + */ + public Boolean isRunning() + { + return Boolean.valueOf(serviceAdapter.isStarted()); + } + + /* + * (non-Javadoc) + * @see flex.management.runtime.ServiceAdapterControlMBean#getStartTimestamp() + */ + public Date getStartTimestamp() + { + return startTimestamp; + } + + /* + * (non-Javadoc) + * @see javax.management.MBeanRegistration#preDeregister() + */ + public void preDeregister() throws Exception + { + DestinationControl parent = (DestinationControl)getParentControl(); + parent.setAdapter(null); + + super.preDeregister(); + } +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/bf2e1dc9/core/src/flex/management/runtime/messaging/services/ServiceAdapterControlMBean.java ---------------------------------------------------------------------- diff --git a/core/src/flex/management/runtime/messaging/services/ServiceAdapterControlMBean.java b/core/src/flex/management/runtime/messaging/services/ServiceAdapterControlMBean.java new file mode 100644 index 0000000..5bcc57c --- /dev/null +++ b/core/src/flex/management/runtime/messaging/services/ServiceAdapterControlMBean.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 flex.management.runtime.messaging.services; + +import java.io.IOException; +import java.util.Date; + +import flex.management.BaseControlMBean; + +/** + * Defines the runtime monitoring and management interface for service adapters. + */ +public interface ServiceAdapterControlMBean extends BaseControlMBean +{ + /** + * Returns <code>true</code> if the <code>ServiceAdapter</code> is running. + * + * @return <code>true</code> if the <code>ServiceAdapter</code> is running. + * @throws IOException Throws IOException. + */ + Boolean isRunning() throws IOException; + + /** + * Returns the start timestamp for the <code>ServiceAdapter</code>. + * + * @return The start timestamp for the <code>ServiceAdapter</code>. + * @throws IOException Throws IOException. + */ + Date getStartTimestamp() throws IOException; + +}
