Hello, I would like to create somtehing like a remote
filesystem with ejb. A classic design for that is:
public abstract class Item {
public void setName(String name) { ... }
public String getName() { ... }
}
public class File extends Item {
public void setContent(String content) { ... }
public String getContent() { ... }
}
public class Directory extends Item {
public Item[] list() { ... }
public void add(Item item) { ... }
}
With an ejb design, things are more complicated, as I wish
keep the inheritance diagram. I consider two entity beans,
even three classes implements javax.ejb.EntityBean:
FileBean and DirectoryBean. I thought something like that:
first, the file framework:
public interface AsbtractItem {
void setName(String name) throws RemoteException;
String getName() throws RemoteException;
}
public interface AbstractFile extends AbstractItem {
void setContent(String content) throws RemoteException;
String getContent() throws RemoteException;
}
public interface AbstractDirectory extends AbstractItem {
Item[] list() throws RemoteException;
void add(Item item) throws RemoteException;
}
now, the remote interfaces for the ejb framework:
public interface File extends AbstractFile, javax.ejb.EJBObject { }
public interface Directory extends AbstractDirectory, javax.ejb.EJBObject { }
then, the beans for the ejb framework:
public abstract class ItemBean implements AbstractItem, javax.ejb.EntityBean {
public void setName(String name) { ... }
public String getName() { ... }
}
public class FileBean extends ItemBean implements AbstractFile {
public void setContent(String content) { ... }
public String getContent() { ... }
+ bean callback implementation
}
public class DirectoryBean extends ItemBean implements AbstractDirectory {
public Item[] list() { ... }
public void add(Item item) { ... }
+ bean callback implementation
}
I don't detail Home interfaces here.
What do you think of that, am I wrong ?
Does someone has yet done that before ?
Bye
-
Remote file system with ejb design (1 messages)
- Posted by: Julien Viet
- Posted on: November 21 2000 06:51 EST
Threaded Messages (1)
- Remote file system with ejb design by Benedict Chng on November 21 2000 13:02 EST
-
Remote file system with ejb design[ Go to top ]
- Posted by: Benedict Chng
- Posted on: November 21 2000 13:02 EST
- in response to Julien Viet
If you're using Weblogic, there's a Weblogic File services component that you might want to take a look at, even if you're not using Weblogic.
This overview from Weblogic docs:
WebLogic File is a service added to WebLogic in release 2.5. WebLogic File provides high-speed client-side access to native operating system files on the server. The client API extends the lowest-common-denominator capabilities of Java (java.io.InputStream and java.io.OutputStream), which allows it to be used seamlessly in existing code, with additional services that are specific to manipulating remote files.
Check out http://www.weblogic.com/docs40/classdocs/API_file.html
Benedict Chng