RE: Repository API query

"Stephen McConnell" <[email protected]>
Newsgroups gmane.comp.jakarta.avalon.user
Message-ID <003a01c49abc$a43e1e00$1601a8c0@gloria>

> -----Original Message-----
> From: Rajamani Saravanan [mailto:[email protected]]
> Sent: 14 September 2004 20:57
> To: Avalon framework users
> Subject: Repository API query
> 
> Hi,
> 
> I have one query re. the repository API: I'm loading a block
> dynamically from inside my code - the block's jar and the .meta files
> are located on a local repository (locally running tomcat instance).
> The code I've used is this:
> 
> m_hBlock = m_hModel.addContainmentModel(
>     new URL(null, "artifact:xyz/SampleModule#0.1", new
> ArtifactHandler()));
> 
> m_hBlock.commission();
> 
> The code works fine, the block gets downloaded, installed to the local
> avalon repository, and instantiated. The question is: if the timestamp
> of the jar is changed on the server but the version number is not
> changed (the .meta file contains the changes), will the next call to
> the above code check for the timestamp change? 

No.

> If no, can this be done
> at all, what should I do to enable this check?

Set the artifact to SNAPSHOT.

> Again, the URL can also be of the form "block:xyz/SampleBlock#0.1" :
> what is the difference between using this syntax and the above one? If
> I use this code, the file that gets tried for downloading is
> "xyz/SampleBlock-0.1.block" - what is the structure of a .block file?

A block file is exactly the same as the file in BLOCK-INF/block.xml with
one addition - it contains a reference to the jar within the
classloader.  Personally I just use blocks (referred to as standalone
blocks) because it gives me a little more flexibility on deployment (you
can play around with the block without having to rebuild the jar).

Cheers, Steve.


> Any pointers will be helpful...
> 
> Brgds,
> 
> R. Saravanan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.