You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Ulrich Mayring <ul...@denic.de> on 2001/11/12 18:56:29 UTC

Blocks and libs

Hello,

I am currently writing a block as a wrapper around some third-party
code, which is available as a .jar file. This block will be used in many
.sar applications. Where do I put the 3rdparty.jar? Currently I see two
ways:

- in the .sar application's lib directory
- in Avalon's general lib directory

Both methods have the disadvantage that I cannot just give the block to
someone and it will run. I have to tell him "put 3rdparty.jar in
Avalon's lib directory or in your .sar application's lib directory and
take care that you get the right version of 3rdparty.jar". Is there
another way to associate a .jar with a certain block, so it can be
deployed as a unit?

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Blocks and libs

Posted by Ulrich Mayring <ul...@denic.de>.
Peter Donald wrote:
> 
> If you chuck the jar inside the .sar in
> 
> lib/3rdparty.jar (oldstyle)
> SAR-INF/lib/3rdparty.jar (newstyle)
> 
> It should work fine.

Yeah, it works fine, but I have to repeat that step for every .sar
application that uses this block. I'd rather have the block be
self-contained. Then it could also be distributed as a ready-to-run .bar
file.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Blocks and libs

Posted by Peter Donald <do...@apache.org>.
On Tue, 13 Nov 2001 04:56, Ulrich Mayring wrote:
> I am currently writing a block as a wrapper around some third-party
> code, which is available as a .jar file. This block will be used in many
> .sar applications. Where do I put the 3rdparty.jar? Currently I see two
> ways:
>
> - in the .sar application's lib directory
> - in Avalon's general lib directory
>
> Both methods have the disadvantage that I cannot just give the block to
> someone and it will run. I have to tell him "put 3rdparty.jar in
> Avalon's lib directory or in your .sar application's lib directory and
> take care that you get the right version of 3rdparty.jar". Is there
> another way to associate a .jar with a certain block, so it can be
> deployed as a unit?

If you chuck the jar inside the .sar in 

lib/3rdparty.jar (oldstyle)
SAR-INF/lib/3rdparty.jar (newstyle)

It should work fine.

-- 
Cheers,

Pete

"Artists can color the sky red because they know it's blue.  Those of us who
 aren't artists must color things the way they really are or people might 
 think we're stupid." -- Jules Feiffer 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Blocks and libs

Posted by Peter Donald <do...@apache.org>.
On Tue, 13 Nov 2001 20:07, Ulrich Mayring wrote:
> Peter Donald wrote:
> > oh. I may have a solution for that in a week or two ;)
> >
> > What you may want to do is declare a dependency via Optional Package
> > mechanism. See
> > http://java.sun.com/j2se/1.3/docs/guide/extensions/versioning.html
> >
> > Then the container should find required dependencies from a central
> > repository.
>
> Oops, saw this message too late. Yes, something like that would be cool.
> Currently I'm leaning towards putting the jar in the central lib
> directory of Avalon, rather than in every .sar application's lib
> directory. IMHO a central lib-repository with some mechanisms to use it
> has been on top of my Java-wishlist for a long time.

Okay I went and implemented it yesterday afternoon. So now the jars that 
contain blocks can declare dependencies on external libraries aka "Optional 
Packages". I have tested it a fair bit in one of my own apps and all seems 
good. 

However it is completely undocumented at this stage. I probably wont get a 
chance to document till later in the week .. maybe thursday. Till then you 
can read the above link and if thats not enough you can look at the 
simpleserver demo in cornerstone. This shows a simple usage of the 
Optional Packages/extensions code. 

Anyways I will write up proper docs sometime later if thats not enough. The 
central repository is located at ${phoenix.home}/ext. The only thing that is 
unimplemented (and it will stay unimplemented for security reasons) is the 
Implementation-URL: attribute by which you could auotmatically download 
packages. Other than that we should be good to go.

-- 
Cheers,

Pete

*-----------------------------------------------------*
| For those who refuse to understand, no explanation  |
| will ever suffice. For those who refuse to believe, |
| no evidence will ever suffice.                      |
*-----------------------------------------------------*

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Blocks and libs

Posted by Ulrich Mayring <ul...@denic.de>.
Peter Donald wrote:
> 
> oh. I may have a solution for that in a week or two ;)
> 
> What you may want to do is declare a dependency via Optional Package
> mechanism. See
> http://java.sun.com/j2se/1.3/docs/guide/extensions/versioning.html
> 
> Then the container should find required dependencies from a central
> repository.

Oops, saw this message too late. Yes, something like that would be cool.
Currently I'm leaning towards putting the jar in the central lib
directory of Avalon, rather than in every .sar application's lib
directory. IMHO a central lib-repository with some mechanisms to use it
has been on top of my Java-wishlist for a long time.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Blocks and libs

Posted by Peter Donald <do...@apache.org>.
On Tue, 13 Nov 2001 06:27, Peter Royal wrote:
> On Monday 12 November 2001 02:23 pm, you wrote:
> > TP jars go in SAR-INF/lib same as blocks.
>
> I think he's looking for a way to have a block that requires a TP jar to be
> self contained -- include the TP code in the block file.

oh. I may have a solution for that in a week or two ;) 

What you may want to do is declare a dependency via Optional Package 
mechanism. See 
http://java.sun.com/j2se/1.3/docs/guide/extensions/versioning.html

Then the container should find required dependencies from a central 
repository.

-- 
Cheers,

Pete

--------------------------------------------------
 The fact that nobody understands you doesn't 
 mean you're an artist.
--------------------------------------------------

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Blocks and libs

Posted by Peter Royal <pr...@managingpartners.com>.
On Monday 12 November 2001 02:23 pm, you wrote:
> TP jars go in SAR-INF/lib same as blocks.

I think he's looking for a way to have a block that requires a TP jar to be 
self contained -- include the TP code in the block file.
-pete

>
> - PAul
>
> >Hello,
> >
> >I am currently writing a block as a wrapper around some third-party
> >code, which is available as a .jar file. This block will be used in many
> >.sar applications. Where do I put the 3rdparty.jar? Currently I see two
> >ways:
> >
> >- in the .sar application's lib directory
> >- in Avalon's general lib directory
> >
> >Both methods have the disadvantage that I cannot just give the block to
> >someone and it will run. I have to tell him "put 3rdparty.jar in
> >Avalon's lib directory or in your .sar application's lib directory and
> >take care that you get the right version of 3rdparty.jar". Is there
> >another way to associate a .jar with a certain block, so it can be
> >deployed as a unit?
> >
> >Ulrich

-- 
peter royal -> proyal@managingpartners.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Blocks and libs

Posted by Paul Hammant <Pa...@yahoo.com>.
Ulrich

TP jars go in SAR-INF/lib same as blocks.

- PAul

>Hello,
>
>I am currently writing a block as a wrapper around some third-party
>code, which is available as a .jar file. This block will be used in many
>.sar applications. Where do I put the 3rdparty.jar? Currently I see two
>ways:
>
>- in the .sar application's lib directory
>- in Avalon's general lib directory
>
>Both methods have the disadvantage that I cannot just give the block to
>someone and it will run. I have to tell him "put 3rdparty.jar in
>Avalon's lib directory or in your .sar application's lib directory and
>take care that you get the right version of 3rdparty.jar". Is there
>another way to associate a .jar with a certain block, so it can be
>deployed as a unit?
>
>Ulrich
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>