001: /*
002: * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
003: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
004: */
005:
006: //
007: package com.sun.portal.ffj.modules;
008:
009: //
010: import java.beans.PropertyVetoException;
011: import java.io.IOException;
012:
013: import org.netbeans.modules.xml.core.XMLDataObject;
014:
015: import org.openide.TopManager;
016: import org.openide.ErrorManager;
017: import org.openide.filesystems.FileSystem;
018: import org.openide.modules.ModuleInstall;
019:
020: import com.sun.portal.ffj.filesystems.PSFileSystem;
021: import com.sun.portal.ffj.filesystems.PSRuntimeJarFS;
022: import com.sun.portal.ffj.filesystems.PortletJarFS;
023: import com.sun.portal.ffj.filesystems.PSFSInstall;
024: import com.sun.portal.ffj.util.PSConstants;
025:
026: //
027:
028: public class PSInstall extends ModuleInstall implements PSConstants {
029: //
030: // private static RepositoryListener psRepositoryListener = new PSRepositoryAdapter();
031:
032: public void installed() {
033: String method = "installed: ";
034: System.out.println(method + "Entry");
035:
036: restored();
037:
038: /*
039: try {
040: PSFileSystem.mount();
041: PSRuntimeJarFS.mount();
042: PortletJarFS.mount();
043: PSFSInstall.postCreate();
044: }
045: catch (Exception e) {
046: TopManager.getDefault().getErrorManager().notify(ErrorManager.USER, e);
047: }
048: **/
049:
050: System.out.println(method + "Exit");
051: }
052:
053: public void restored() {
054: String method = "restored: ";
055: System.out.println(method + "Entry");
056:
057: //
058: // registerParEntryInstance();
059:
060: // Add our RepositoryListener.
061: // TopManager.getDefault().getRepository().addRepositoryListener(psRepositoryListener);
062:
063: //
064: System.out.println(method + "Exit");
065: }
066:
067: public void uninstalled() {
068: String method = "uninstalled: ";
069: System.out.println(method + "Entry");
070:
071: //
072: // unregisterParEntryInstance();
073:
074: //
075: FileSystem psFS = PSFileSystem.getPSFilesystem(false);
076:
077: if (psFS != null) {
078: //
079: TopManager.getDefault().getRepository().removeFileSystem(
080: psFS);
081: PSRuntimeJarFS.unmount();
082: PortletJarFS.unmount();
083:
084: System.out.println(method + "Unmounted iPS filesystem");
085: }
086:
087: // Remove our RepositoryListener.
088: // TopManager.getDefault().getRepository().removeRepositoryListener(psRepositoryListener);
089: // psRepositoryListener = null;
090:
091: //
092: System.out.println(method + "Exit");
093: }
094:
095: //
096: //
097: //
098: private void registerParEntryInstance() {
099: String method = "registerParEntryInstance: ";
100: System.out.println(method + "Entry");
101:
102: //
103: XMLDataObject.Info info = new XMLDataObject.Info();
104: try {
105: info.addProcessorClass(Class.forName(
106: "com.sun.portal.ffj.cookies.ParEntryInstance",
107: false, getClass().getClassLoader()));
108: } catch (ClassNotFoundException cnfe) {
109: throw new NoClassDefFoundError(cnfe.toString());
110: }
111:
112: //
113: XMLDataObject.registerInfo(PARENTRY_DTD_ID, info);
114:
115: //
116: System.out.println(method + "Exit");
117: }
118:
119: private void unregisterParEntryInstance() {
120: String method = "unregisterParEntryInstance: ";
121: System.out.println(method + "Entry");
122:
123: //
124: XMLDataObject.registerInfo(PARENTRY_DTD_ID, null);
125:
126: //
127: System.out.println(method + "Exit");
128: }
129:
130: //
131: //
132: //
133: }
|