Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

ISProxy.java

00001 /*
00002  * ISProxy.java
00003  *
00004  * Created on 30 October 2003, 07:19
00005  */
00006 
00007 package Sct.ISProxy;
00008 
00009 import Sct.*;
00010 import Sct.File.*;
00015 public class ISProxy implements Serializable {
00016     
00017     public ISProxy(String fileName) {
00018         setFileName(fileName);
00019     }
00020     
00022     public ISProxy(Serializable object) {
00023         filename = new NameFile(object).getName();
00024         uniqueID = object.getUniqueID();
00025         className = object.getClassName();
00026     }
00027     
00028     public String getClassName() {
00029         return className;        
00030     }
00031     
00032     public String getUniqueID() {
00033         return uniqueID;
00034     }
00035     
00036     public void write(OStream s, ObjectManager o) throws java.io.IOException {
00037         s.writeString("FileName", filename);
00038     }
00039     
00040     public static Serializable read(IStream s, ObjectManager o) throws java.io.IOException {
00041         String filename = s.readString("FileName");
00042         if (o instanceof ObjectManagerISProxy) {
00043             return new ISProxy(filename);
00044         } else {
00045             return ObjectManagerFile.getInstance().readObject(filename);
00046         }
00047     }
00048     
00049     public String getFileName() {
00050         return filename;
00051     }
00052     
00053     public void setFileName(String fileName) {        
00054         this.filename = fileName;
00055         NameFile nf = new NameFile(fileName);
00056         uniqueID = nf.getUniqueID();
00057         className = nf.getClassName();
00058     }
00059     
00060     private String filename;
00061     private String uniqueID;
00062     private String className;
00063 }

Generated on Thu Jul 15 09:55:44 2004 for SCT DAQ/DCS Software - Java by doxygen 1.3.5