You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Jaliya Ekanayake <ja...@opensource.lk> on 2005/04/18 13:51:25 UTC

[Axis 2] Storage Mechanism for Axis 2

Hi All,
 
We started looking into implementing of WS-RM on top of Axis 2. There is a
need for a persistent storage mechanism for messages and some other related
objects. We believe that axis should facilitate the function of saving the
messages (in-memory or in a database), since there may be many usages of
this in different modules. 
As an API we would like to propose the following


------------------------------------------------
package org.apache.axis.storage;
 
public interface Storage {
 
    public String put(Object value);
 
    public Object get(Object key); 
}  
 
------------------------------------------------
 
package org.apache.axis.storage;
public class InMemoryStorage implements Storage {
}
 
------------------------------------------------
 
package org.apache.axis.storage;
public class PersistanceStorage implements Storage {
}
 
------------------------------------------------
 
However we noted that in the AbstractContext class under the package
org.apache.axis.context package, it uses some persistence and non
persistence hash tables for storing objects. So is it true that  ultimately
the implementations of the "Context" will use the Storage mechanism provided
by axis to store its contents?
Please send your comments on this.
 
Thanks,
 
Jaliya, Chamikara and Saminda
 
 
 




Re: [Axis 2] Storage Mechanism for Axis 2

Posted by Thilina Gunarathne <cs...@gmail.com>.
Hi,
MTOM impl is also in need of a storage mechanism for large attachments. We 
were thinking of storing large attchments temporarily as files. But then 
there arises the problem of how to delete them after processing. 
Is it possible for us to use the same persistant storage for the above 
purpose. Will the size of the objects will be a problem.

thanks,

~Thilina.
thilina@opensource.lk


On 4/18/05, Jaliya Ekanayake <ja...@opensource.lk> wrote:
> 
> 
> Hi All,
> 
> 
> 
> We started looking into implementing of WS-RM on top of Axis 2. There is a
> need for a persistent storage mechanism for messages and some other 
related
> objects. We believe that axis should facilitate the function of saving the
> messages (in-memory or in a database), since there may be many usages of
> this in different modules. 
> 
> As an API we would like to propose the following
> 
> 
> 
> ------------------------------------------------
> 
> package org.apache.axis.storage;
> 
> 
> 
> public interface Storage {
> 
> 
> 
> public String put(Object value);
> 
> 
> 
> public Object get(Object key); 
> 
> } 
> 
> 
> 
> ------------------------------------------------
> 
> 
> 
> package org.apache.axis.storage;
> 
> public class InMemoryStorage implements Storage {
> 
> }
> 
> 
> 
> ------------------------------------------------
> 
> 
> 
> package org.apache.axis.storage;
> 
> public class PersistanceStorage implements Storage {
> 
> }
> 
> 
> 
> ------------------------------------------------
> 
> 
> 
> However we noted that in the AbstractContext class under the package
> org.apache.axis.context package, it uses some persistence and non
> persistence hash tables for storing objects. So is it true that ultimately
> the implementations of the "Context" will use the Storage mechanism 
provided
> by axis to store its contents?
> 
> Please send your comments on this.
> 
> 
> 
> Thanks,
> 
> 
> 
> Jaliya, Chamikara and Saminda
> 
> 
> 
> 
> 
> 
> 
> 
> 
>

RE: [Axis2] Storage Mechanism for Axis 2

Posted by Jaliya Ekanayake <ja...@opensource.lk>.
Hi All,
 
+1 for coupling the storage mechanism with engine.  So this is inline with
the storage mechanism proposed by us (Chamikara, Saminda and Me). That is 
 
getEngineContext().getStorage() will return an object of type Storage as
mentioned in the server.xml. There can be many implementations of this
Storage interface. We will first implement an in-memory storage and later
may be with some database.
 
package org.apache.axis.storage ;

 public interface Storage {
     public String put(Object value);
     public Object get(Object key); 
}  
------------------------------------------------
package org.apache.axis.storage;
  public class InMemoryStorage implements Storage {  }

------------------------------------------------

 package org.apache.axis.storage;
 public class PersistanceStorage implements Storage {  }
 
Thanks,
 
Jaliya
 
  _____  

From: Ajith Ranabahu [mailto:ajith.ranabahu@gmail.com] 
Sent: Tuesday, April 19, 2005 12:04 PM
To: axis-dev@ws.apache.org
Subject: Re: [Axis 2] Storage Mechanism for Axis 2
 
Hi All,
The storage interface is really a thing that I look forward for having. But
how I see it (thanks to Dasarath who mentioned the original idea) this
Storage interface should be coupled with store /  retrieve methods in the
engine (or such a central component)
Then we can have any kind of Storage implementation associated with an
instance of the engine and expect it to behave accordingly. The correct
storage instance can be kept in the engine conetext. have a look at the code
I am proposing.

class engine{
// Lot of methods here....

public Object store(Object obj) {
  return this.getEngineContext().getStorage().put(obj);
}
public Objectstore(Object key) {
  return this.getEngineContext().getStorage().get(key);
}
}

in this case the user (probably the handlers) need not think of the
underlying storage mechanism. Which implementation of the storage to use
will be in the server.xml. Hence high end servers can have more robust
storages (say a jdbcStorage) and low end ones can have simpler ones (like
the fileStorage). 

Serializing the contexts is a different matter. They can use the store and
retrieve facilities if they want to but I will prefer them to have a
standard serialization since the contexts are part of the systems run time
environment. IMHO this storage thing is a facility provided by Axis and does
not come directly under the axis runtime environment.

thoughts ??

-- 
Ajith Ranabahu 

Re: [Axis 2] Storage Mechanism for Axis 2

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi All,
The storage interface is really a thing that I look forward for having. But 
how I see it (thanks to Dasarath who mentioned the original idea) this 
Storage interface should be coupled with store / retrieve methods in the 
engine (or such a central component)
Then we can have any kind of Storage implementation associated with an 
instance of the engine and expect it to behave accordingly. The correct 
storage instance can be kept in the engine conetext. have a look at the code 
I am proposing.

class engine{
// Lot of methods here....

public Object store(Object obj) {
return this.getEngineContext().getStorage().put(obj);
}
public Objectstore(Object key) {
return this.getEngineContext().getStorage().get(key);
}
}

in this case the user (probably the handlers) need not think of the 
underlying storage mechanism. Which implementation of the storage to use 
will be in the server.xml. Hence high end servers can have more robust 
storages (say a jdbcStorage) and low end ones can have simpler ones (like 
the fileStorage). 

Serializing the contexts is a different matter. They can use the store and 
retrieve facilities if they want to but I will prefer them to have a 
standard serialization since the contexts are part of the systems run time 
environment. IMHO this storage thing is a facility provided by Axis and does 
not come directly under the axis runtime environment.

thoughts ??

-- 
Ajith Ranabahu