KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mx4j > examples > tools > persister > MBeanOne


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8 package mx4j.examples.tools.persister;
9
10
11 /**
12  * An MBean that extends FilePersister to demonstrate the usage of the mx4j.persist.FilePersister
13  * @version $Revision: 1.1 $
14  */

15
16 import java.io.Serializable JavaDoc;
17 import javax.management.InstanceNotFoundException JavaDoc;
18 import javax.management.MBeanException JavaDoc;
19 import javax.management.RuntimeOperationsException JavaDoc;
20
21 import mx4j.persist.FilePersister;
22
23 public class MBeanOne extends FilePersister implements Serializable JavaDoc
24 {
25    private String JavaDoc m_location;
26    private String JavaDoc m_name;
27
28    public MBeanOne(String JavaDoc location, String JavaDoc name) throws MBeanException JavaDoc
29    {
30       super(location, name);
31       m_location = location;
32       m_name = name;
33    }
34
35    // ask FilePersister to store the Object
36
public void store(Object JavaDoc mbean) throws MBeanException JavaDoc, InstanceNotFoundException JavaDoc
37    {
38       store(mbean);
39    }
40
41    // return the Object
42
public Object JavaDoc load() throws MBeanException JavaDoc, RuntimeOperationsException JavaDoc, InstanceNotFoundException JavaDoc
43    {
44       return load();
45    }
46 }
47
Popular Tags