View Javadoc

1   /* $Id: SimpleReflectingMBeanOperation.java 4012 2005-12-14 18:08:08Z dbernstein $
2    *
3    * (Created on Dec 12, 2005
4    *
5    * Copyright (C) 2005 Internet Archive.
6    *  
7    * This file is part of the Heritrix Cluster Controller (crawler.archive.org).
8    *  
9    * HCC is free software; you can redistribute it and/or modify
10   * it under the terms of the GNU Lesser Public License as published by
11   * the Free Software Foundation; either version 2.1 of the License, or
12   * any later version.
13   * 
14   * Heritrix is distributed in the hope that it will be useful, 
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU Lesser Public License for more details.
18   * 
19   * You should have received a copy of the GNU Lesser Public License
20   * along with Heritrix; if not, write to the Free Software
21   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22   */
23  
24  package org.archive.hcc.util.jmx;
25  
26  import javax.management.openmbean.OpenMBeanOperationInfo;
27  
28  /***
29   * This class binds an open mbean operation definition to a specific invocation
30   * target. It saves the user from having to write the code to marshall and
31   * unmarshal simple open mbean invocations.
32   * 
33   * @author Daniel Bernstein (dbernstein@archive.org)
34   * 
35   */
36  public class SimpleReflectingMBeanOperation
37          extends
38              MBeanOperationBase {
39  
40      /***
41       * The invocation target.
42       */
43      private Object target;
44  
45      /***
46       * @param info
47       */
48      public SimpleReflectingMBeanOperation(
49              Object target,
50              OpenMBeanOperationInfo info) {
51          super(info);
52          this.target = target;
53      }
54  
55      /*
56       * (non-Javadoc)
57       * 
58       * @see org.archive.hcc.util.jmx.MBeanOperationBase#getInvocation(java.lang.Object[])
59       */
60      public MBeanInvocation getInvocation(Object[] params) {
61          return new SimpleReflectingMbeanInvocation(
62                  this.target,
63                  getInfo(),
64                  params);
65      }
66  
67  }