* Start this plugin
*/
protected void startPlugin() throws PluginException {
log.info("start jifs");
try {
JIFileSystemType type = null;
try {
VirtualDevice dev =
VirtualDeviceFactory.createDevice(JIFileSystemType.VIRTUAL_DEVICE_NAME);
log.info(dev.getId() + " registered");
final FileSystemService fSS = InitialNaming.lookup(FileSystemService.NAME);
type = fSS.getFileSystemType(JIFileSystemType.ID);
final JIFileSystem fs = type.create(dev, true);
fSS.registerFileSystem(fs);
final String mountPath = "jifs";
fSS.mount(mountPath, fs, null);
log.info("Mounted " + type.getName() + " on " + mountPath);
final ExtensionPoint infoEP = getDescriptor().getExtensionPoint("info");
jifsExtension = new JIFSExtension(infoEP);
} catch (DeviceAlreadyRegisteredException ex) {
log.error("jifs is currently running.");
} catch (FileSystemException ex) {
log.error("Cannot mount " + (type != null ? type.getName() : "") + " filesystem ",
ex);
} catch (DeviceException e) {
log.debug("Got DriverException, maybe jifs is running.");
} catch (IOException ex) {
log.error("Cannot mount jifs", ex);