001// Copyright 2005 The Apache Software Foundation
002//
003// Licensed under the Apache License, Version 2.0 (the "License");
004// you may not use this file except in compliance with the License.
005// You may obtain a copy of the License at
006//
007//     http://www.apache.org/licenses/LICENSE-2.0
008//
009// Unless required by applicable law or agreed to in writing, software
010// distributed under the License is distributed on an "AS IS" BASIS,
011// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012// See the License for the specific language governing permissions and
013// limitations under the License.
014
015package org.apache.hivemind.management;
016
017import java.util.Map;
018
019import javax.management.JMException;
020import javax.management.ObjectName;
021
022import org.apache.hivemind.InterceptorStack;
023import org.apache.hivemind.impl.MessageFormatter;
024
025/**
026 * Messages for the management package.
027 * 
028 * @author Achim Huegen
029 * @since 1.1
030 */
031public class ManagementMessages
032{
033    protected static MessageFormatter _formatter = new MessageFormatter(ManagementMessages.class);
034
035    public static String errorInstantiatingPerformanceInterceptor(String serviceId,
036            InterceptorStack stack, Throwable cause)
037    {
038        return _formatter.format("error-instantiating-performance-interceptor", new Object[]
039        { serviceId, stack.getServiceInterface().getName(), stack.getServiceExtensionPointId(),
040                cause });
041    }
042
043    public static String errorInstantiatingConnectorServer(String jmxServiceURL, Map env,
044            Throwable cause)
045    {
046        return _formatter.format("error-instantiating-connector-server", new Object[]
047        { jmxServiceURL, cause });
048    }
049
050    public static String errorRegisteringMBean(ObjectName objectName, JMException cause)
051    {
052        return _formatter.format("error-registering-mbean", new Object[]
053        { objectName, cause });
054    }
055
056    public static String errorUnregisteringMBean(ObjectName objectName, JMException cause)
057    {
058        return _formatter.format("error-unregistering-mbean", new Object[]
059        { objectName, cause.getMessage() });
060    }
061
062    public static String errorStartMethodFailed(String startMethod, ObjectName objectName,
063            Throwable cause)
064    {
065        return _formatter.format("error-start-method-failed", new Object[]
066        { startMethod, objectName, cause });
067    }
068}