01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08: package mx4j.examples.tools.persister;
09:
10: /**
11: * An MBean that extends FilePersister to demonstrate the usage of the mx4j.persist.FilePersister
12: * @version $Revision: 1.1 $
13: */
14:
15: import java.io.Serializable;
16: import javax.management.InstanceNotFoundException;
17: import javax.management.MBeanException;
18: import javax.management.RuntimeOperationsException;
19:
20: import mx4j.persist.FilePersister;
21:
22: public class MBeanOne extends FilePersister implements Serializable {
23: private String m_location;
24: private String m_name;
25:
26: public MBeanOne(String location, String name) throws MBeanException {
27: super (location, name);
28: m_location = location;
29: m_name = name;
30: }
31:
32: // ask FilePersister to store the Object
33: public void store(Object mbean) throws MBeanException,
34: InstanceNotFoundException {
35: store(mbean);
36: }
37:
38: // return the Object
39: public Object load() throws MBeanException,
40: RuntimeOperationsException, InstanceNotFoundException {
41: return load();
42: }
43: }
|