001// *************************************************************************************************************************** 002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * 003// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * 004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * 005// * with the License. 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 distributed under the License is distributed on an * 010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * 011// * specific language governing permissions and limitations under the License. * 012// *************************************************************************************************************************** 013package org.apache.juneau.remoteable; 014 015import java.lang.reflect.*; 016import java.text.*; 017 018import org.apache.juneau.*; 019 020/** 021 * @deprecated Internal class. 022 */ 023@Deprecated 024public class RemoteableMetadataException extends FormattedRuntimeException { 025 026 private static final long serialVersionUID = 1L; 027 028 /** 029 * Constructor. 030 * 031 * @param m The interface method that has an invalid definition. 032 * @param message The {@link MessageFormat}-style message. 033 * @param args Optional {@link MessageFormat}-style arguments. 034 */ 035 public RemoteableMetadataException(Method m, String message, Object...args) { 036 super(getMessage(m.getDeclaringClass(), m, message), args); 037 } 038 039 /** 040 * Constructor. 041 * 042 * @param c The interface class that has an invalid definition. 043 * @param message The {@link MessageFormat}-style message. 044 * @param args Optional {@link MessageFormat}-style arguments. 045 */ 046 public RemoteableMetadataException(Class<?> c, String message, Object...args) { 047 super(getMessage(c, null, message), args); 048 } 049 050 private static final String getMessage(Class<?> c, Method m, String msg) { 051 StringBuilder sb = new StringBuilder("Invalid remoteable definition found on class ").append(c.getName()); 052 if (m != null) 053 sb.append(" on method ").append(m.getName()); 054 sb.append(". ").append(msg); 055 return sb.toString(); 056 } 057}