You are viewing a plain text version of this content. The canonical link for it is here.
Posted to phoenix-dev@avalon.apache.org by Ulrich Mayring <ul...@denic.de> on 2002/09/30 12:07:24 UTC

Phoenix and the Web

Hello folks,

given my recent (unsuccessful) endeavour of getting Jo! to run under Phoenix, I 
began to wonder what a connection between Phoenix and the Web could/should look 
like. I think it is imperative for a server application framework and an 
applicaton server to be able to serve the Web.

Here are some options I can think of:

1) There is a class called PhoenixServlet, but it is labelled as experimental. 
It does not seem to do very much either. What is its purpose?

2) Jo! and Sevak can run servlets, but they have no native way to communicate 
with other apps (except via AltRMI or similar methods). I don't think it is 
possible to persuade the developers of Jo! or Catalina to componentize their 
designs to accommodate Avalon/Phoenix. But everything else is just a hack.

3) How about an ajpv12 or ajpv13 component? Maybe the code can be nicked from 
Catalina and repackaged as a component. Then every Phoenix app could just use 
that component and be fully connected to everyone who supports mod_jk or 
mod_jserv (mainly the Apache httpd, but also some other webservers).

4) MX4J already has a HTTPConnector, but it is fairly limited to JMX. But we 
just need a way to pass control to an arbitrary app and give back a response, 
maybe it can be done with MX4J?

5) Development of a HTTP component. It does not need to be a full-blown 
webserver, we just need to speak HTTP. For access control, URL rewriting, error 
handling and all those other fancy features we could rely on an external 
webserver and assume that he makes sure to forward only "safe and appropriate" 
HTTP requests to us for backend processing. Connections have to be limited to 
that webserver, though. Most webservers have a way to forward HTTP requests to 
another webserver.

Any other ideas/comments? I like option 3) best.

cheers,

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung


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


Re: Phoenix and the Web

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

Jo! not has been ported to the sevak project. If you have phoenix/ and 
apps/ in adjascent directories you can deploy a test SAR for Jo! with...
  ant -buildfile jo.xml install

Similarly Catalin's test SAR can be installed with ...
  ant -buildfile jetty.xml install

When we get Jetty working, it will be deployable with ...
  ant -buildfile jetty.xml install

You will have to have built phoenix via the dist-lite target first.

Regards,

- Paul



> Hello folks,
>
> given my recent (unsuccessful) endeavour of getting Jo! to run under 
> Phoenix, I began to wonder what a connection between Phoenix and the 
> Web could/should look like. I think it is imperative for a server 
> application framework and an applicaton server to be able to serve the 
> Web.
>
> Here are some options I can think of:
>
> 1) There is a class called PhoenixServlet, but it is labelled as 
> experimental. It does not seem to do very much either. What is its 
> purpose?
>
> 2) Jo! and Sevak can run servlets, but they have no native way to 
> communicate with other apps (except via AltRMI or similar methods). I 
> don't think it is possible to persuade the developers of Jo! or 
> Catalina to componentize their designs to accommodate Avalon/Phoenix. 
> But everything else is just a hack.
>
> 3) How about an ajpv12 or ajpv13 component? Maybe the code can be 
> nicked from Catalina and repackaged as a component. Then every Phoenix 
> app could just use that component and be fully connected to everyone 
> who supports mod_jk or mod_jserv (mainly the Apache httpd, but also 
> some other webservers).
>
> 4) MX4J already has a HTTPConnector, but it is fairly limited to JMX. 
> But we just need a way to pass control to an arbitrary app and give 
> back a response, maybe it can be done with MX4J?
>
> 5) Development of a HTTP component. It does not need to be a 
> full-blown webserver, we just need to speak HTTP. For access control, 
> URL rewriting, error handling and all those other fancy features we 
> could rely on an external webserver and assume that he makes sure to 
> forward only "safe and appropriate" HTTP requests to us for backend 
> processing. Connections have to be limited to that webserver, though. 
> Most webservers have a way to forward HTTP requests to another webserver.
>
> Any other ideas/comments? I like option 3) best.
>
> cheers,
>
> Ulrich
>




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


Re: Phoenix and the Web

Posted by Paul Hammant <Pa...@yahoo.com>.
Bruno,

I have added that Log redirector..

>>Bruno, hi there...
>>
>>I have a generalized Jetty block in progress:
>>
>>    
>>
>
>cool
>
>Just wondering, how would you provide the webapplications with access to
>other blocks? By putting the component manager in the servlet context or
>so?
>
Actually, the service is for other blocks.  The servlet spec say that 
webapps are only allowed to "see" J2SE classes and those from J2EE that 
are pertinent to servlets.  I.e. they have to use RMI to speak to 
non-servlet things.

>> http://cvs.apache.org/viewcvs/jakarta-avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/blocks/jetty/
>>
>>The server starts but returns 404 pages for all invocations.
>>Can you see what is wrong?  
>>
>>    
>>
>
>No, but I have not yet tried deploying webapplications. I assume you're
>using the correct virtual host?
>
I have no idea !

- Paul


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


Re: Phoenix and the Web

Posted by Bruno Dumon <br...@outerthought.org>.
On Tue, 2002-10-01 at 01:14, Paul Hammant wrote:
> Bruno, hi there...
> 
> I have a generalized Jetty block in progress:
> 

cool

Just wondering, how would you provide the webapplications with access to
other blocks? By putting the component manager in the servlet context or
so?

>   
>  http://cvs.apache.org/viewcvs/jakarta-avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/blocks/jetty/
> 
> The server starts but returns 404 pages for all invocations.
> Can you see what is wrong?  
> 

No, but I have not yet tried deploying webapplications. I assume you're
using the correct virtual host?

> Also, how would I route Jetty logging thru to Phoenix?

Like this:

import org.mortbay.util.Log;
...
Log.instance().add(new MyLogSink());
...
protected class MyLogSink implements LogSink
{
    public void setOptions(String s)
    {
    }

    public String getOptions()
    {
       return "";
    }

    public void log(String tag, Object message, Frame frame, long time)
    {
        logger.info(tag + " " + message);
    }

    public void log(String formattedLog)
    {
        logger.info(formattedLog);
    }

    public void start() throws Exception
    {
    }

    public void stop() throws InterruptedException
    {
    }

    public boolean isStarted()
    {
       return true;
    }
}

> 
> Regards,
> 
> - Paul
> 
> >I'm using Jetty in a phoenix-based project. Embedding it is just a
> >matter of a few lines of code, here's a small sample program:
> >
> >import org.mortbay.util.InetAddrPort;
> >import org.mortbay.http.*;
> >import org.mortbay.http.handler.AbstractHttpHandler;
> >
> >import java.io.OutputStreamWriter;
> >import java.io.Writer;
> >import java.io.IOException;
> >
> >public class Test
> >{
> >    public static void main(String[] args)
> >        throws Exception
> >    {
> >        HttpServer server = new HttpServer();
> >        HttpContext context = server.getContext(null, "");
> >        context.addHandler(new AbstractHttpHandler()
> >        {
> >            public void handle(String s, String s1, HttpRequest request,
> >HttpResponse response) throws HttpException, IOException
> >            {
> >                try
> >                {
> >                    response.setStatus(HttpResponse.__200_OK);
> >                    response.setContentType("text/xml");
> >                    Writer writer = new
> >OutputStreamWriter(response.getOutputStream());
> >                    writer.write("<html><body>hello</body></html>");
> >                    writer.flush();
> >                    response.commit();
> >                }
> >                catch (Exception e)
> >                {
> >                    e.printStackTrace();
> >                }
> >            }
> >        });
> >        server.addListener(new InetAddrPort(8888));
> >        server.start();
> >    }
> >}
> >
> >Of course, in a phoenix block you would create the server in the
> >initialize method, and start and stop it in the start/stop methods of
> >the Startable interface. It's also possible to redirect jetty's log to
> >an avalon logger. It would probably also be possible to embed jetty's
> >servlet container, if you don't like extending from AbstractHttpHandler.
> >
> >You can find out more about jetty at http://jetty.mortbay.org
> >
> >On Mon, 2002-09-30 at 12:07, Ulrich Mayring wrote:
> >  
> >
> >>Hello folks,
> >>
> >>given my recent (unsuccessful) endeavour of getting Jo! to run under Phoenix, I 
> >>began to wonder what a connection between Phoenix and the Web could/should look 
> >>like. I think it is imperative for a server application framework and an 
> >>applicaton server to be able to serve the Web.
> >>
> >>Here are some options I can think of:
> >>
> >>1) There is a class called PhoenixServlet, but it is labelled as experimental. 
> >>It does not seem to do very much either. What is its purpose?
> >>
> >>2) Jo! and Sevak can run servlets, but they have no native way to communicate 
> >>with other apps (except via AltRMI or similar methods). I don't think it is 
> >>possible to persuade the developers of Jo! or Catalina to componentize their 
> >>designs to accommodate Avalon/Phoenix. But everything else is just a hack.
> >>
> >>3) How about an ajpv12 or ajpv13 component? Maybe the code can be nicked from 
> >>Catalina and repackaged as a component. Then every Phoenix app could just use 
> >>that component and be fully connected to everyone who supports mod_jk or 
> >>mod_jserv (mainly the Apache httpd, but also some other webservers).
> >>
> >>4) MX4J already has a HTTPConnector, but it is fairly limited to JMX. But we 
> >>just need a way to pass control to an arbitrary app and give back a response, 
> >>maybe it can be done with MX4J?
> >>
> >>5) Development of a HTTP component. It does not need to be a full-blown 
> >>webserver, we just need to speak HTTP. For access control, URL rewriting, error 
> >>handling and all those other fancy features we could rely on an external 
> >>webserver and assume that he makes sure to forward only "safe and appropriate" 
> >>HTTP requests to us for backend processing. Connections have to be limited to 
> >>that webserver, though. Most webservers have a way to forward HTTP requests to 
> >>another webserver.
> >>
> >>Any other ideas/comments? I like option 3) best.
> >>
> >>cheers,
> >>
> >>Ulrich
> >>    
> >>
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org


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


Re: Phoenix and the Web

Posted by Paul Hammant <Pa...@yahoo.com>.
Bruno, hi there...

I have a generalized Jetty block in progress:

  
 http://cvs.apache.org/viewcvs/jakarta-avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/blocks/jetty/

The server starts but returns 404 pages for all invocations.
Can you see what is wrong?  

Also, how would I route Jetty logging thru to Phoenix?

Regards,

- Paul

>I'm using Jetty in a phoenix-based project. Embedding it is just a
>matter of a few lines of code, here's a small sample program:
>
>import org.mortbay.util.InetAddrPort;
>import org.mortbay.http.*;
>import org.mortbay.http.handler.AbstractHttpHandler;
>
>import java.io.OutputStreamWriter;
>import java.io.Writer;
>import java.io.IOException;
>
>public class Test
>{
>    public static void main(String[] args)
>        throws Exception
>    {
>        HttpServer server = new HttpServer();
>        HttpContext context = server.getContext(null, "");
>        context.addHandler(new AbstractHttpHandler()
>        {
>            public void handle(String s, String s1, HttpRequest request,
>HttpResponse response) throws HttpException, IOException
>            {
>                try
>                {
>                    response.setStatus(HttpResponse.__200_OK);
>                    response.setContentType("text/xml");
>                    Writer writer = new
>OutputStreamWriter(response.getOutputStream());
>                    writer.write("<html><body>hello</body></html>");
>                    writer.flush();
>                    response.commit();
>                }
>                catch (Exception e)
>                {
>                    e.printStackTrace();
>                }
>            }
>        });
>        server.addListener(new InetAddrPort(8888));
>        server.start();
>    }
>}
>
>Of course, in a phoenix block you would create the server in the
>initialize method, and start and stop it in the start/stop methods of
>the Startable interface. It's also possible to redirect jetty's log to
>an avalon logger. It would probably also be possible to embed jetty's
>servlet container, if you don't like extending from AbstractHttpHandler.
>
>You can find out more about jetty at http://jetty.mortbay.org
>
>On Mon, 2002-09-30 at 12:07, Ulrich Mayring wrote:
>  
>
>>Hello folks,
>>
>>given my recent (unsuccessful) endeavour of getting Jo! to run under Phoenix, I 
>>began to wonder what a connection between Phoenix and the Web could/should look 
>>like. I think it is imperative for a server application framework and an 
>>applicaton server to be able to serve the Web.
>>
>>Here are some options I can think of:
>>
>>1) There is a class called PhoenixServlet, but it is labelled as experimental. 
>>It does not seem to do very much either. What is its purpose?
>>
>>2) Jo! and Sevak can run servlets, but they have no native way to communicate 
>>with other apps (except via AltRMI or similar methods). I don't think it is 
>>possible to persuade the developers of Jo! or Catalina to componentize their 
>>designs to accommodate Avalon/Phoenix. But everything else is just a hack.
>>
>>3) How about an ajpv12 or ajpv13 component? Maybe the code can be nicked from 
>>Catalina and repackaged as a component. Then every Phoenix app could just use 
>>that component and be fully connected to everyone who supports mod_jk or 
>>mod_jserv (mainly the Apache httpd, but also some other webservers).
>>
>>4) MX4J already has a HTTPConnector, but it is fairly limited to JMX. But we 
>>just need a way to pass control to an arbitrary app and give back a response, 
>>maybe it can be done with MX4J?
>>
>>5) Development of a HTTP component. It does not need to be a full-blown 
>>webserver, we just need to speak HTTP. For access control, URL rewriting, error 
>>handling and all those other fancy features we could rely on an external 
>>webserver and assume that he makes sure to forward only "safe and appropriate" 
>>HTTP requests to us for backend processing. Connections have to be limited to 
>>that webserver, though. Most webservers have a way to forward HTTP requests to 
>>another webserver.
>>
>>Any other ideas/comments? I like option 3) best.
>>
>>cheers,
>>
>>Ulrich
>>    
>>




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


Re: Phoenix and the Web

Posted by Bruno Dumon <br...@outerthought.org>.
I'm using Jetty in a phoenix-based project. Embedding it is just a
matter of a few lines of code, here's a small sample program:

import org.mortbay.util.InetAddrPort;
import org.mortbay.http.*;
import org.mortbay.http.handler.AbstractHttpHandler;

import java.io.OutputStreamWriter;
import java.io.Writer;
import java.io.IOException;

public class Test
{
    public static void main(String[] args)
        throws Exception
    {
        HttpServer server = new HttpServer();
        HttpContext context = server.getContext(null, "");
        context.addHandler(new AbstractHttpHandler()
        {
            public void handle(String s, String s1, HttpRequest request,
HttpResponse response) throws HttpException, IOException
            {
                try
                {
                    response.setStatus(HttpResponse.__200_OK);
                    response.setContentType("text/xml");
                    Writer writer = new
OutputStreamWriter(response.getOutputStream());
                    writer.write("<html><body>hello</body></html>");
                    writer.flush();
                    response.commit();
                }
                catch (Exception e)
                {
                    e.printStackTrace();
                }
            }
        });
        server.addListener(new InetAddrPort(8888));
        server.start();
    }
}

Of course, in a phoenix block you would create the server in the
initialize method, and start and stop it in the start/stop methods of
the Startable interface. It's also possible to redirect jetty's log to
an avalon logger. It would probably also be possible to embed jetty's
servlet container, if you don't like extending from AbstractHttpHandler.

You can find out more about jetty at http://jetty.mortbay.org

On Mon, 2002-09-30 at 12:07, Ulrich Mayring wrote:
> Hello folks,
> 
> given my recent (unsuccessful) endeavour of getting Jo! to run under Phoenix, I 
> began to wonder what a connection between Phoenix and the Web could/should look 
> like. I think it is imperative for a server application framework and an 
> applicaton server to be able to serve the Web.
> 
> Here are some options I can think of:
> 
> 1) There is a class called PhoenixServlet, but it is labelled as experimental. 
> It does not seem to do very much either. What is its purpose?
> 
> 2) Jo! and Sevak can run servlets, but they have no native way to communicate 
> with other apps (except via AltRMI or similar methods). I don't think it is 
> possible to persuade the developers of Jo! or Catalina to componentize their 
> designs to accommodate Avalon/Phoenix. But everything else is just a hack.
> 
> 3) How about an ajpv12 or ajpv13 component? Maybe the code can be nicked from 
> Catalina and repackaged as a component. Then every Phoenix app could just use 
> that component and be fully connected to everyone who supports mod_jk or 
> mod_jserv (mainly the Apache httpd, but also some other webservers).
> 
> 4) MX4J already has a HTTPConnector, but it is fairly limited to JMX. But we 
> just need a way to pass control to an arbitrary app and give back a response, 
> maybe it can be done with MX4J?
> 
> 5) Development of a HTTP component. It does not need to be a full-blown 
> webserver, we just need to speak HTTP. For access control, URL rewriting, error 
> handling and all those other fancy features we could rely on an external 
> webserver and assume that he makes sure to forward only "safe and appropriate" 
> HTTP requests to us for backend processing. Connections have to be limited to 
> that webserver, though. Most webservers have a way to forward HTTP requests to 
> another webserver.
> 
> Any other ideas/comments? I like option 3) best.
> 
> cheers,
> 
> Ulrich
-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org


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


Re: Phoenix and the Web

Posted by Peter Donald <pe...@apache.org>.
On Wed, 2 Oct 2002 23:46, Daniel Krieg wrote:
> First of all I would like to thankyou for your input.  I am currently
> working on a specific project and can easily "HACK" together a solution
> that might not necessarily be the best design for standard use.  If I am
> able to create something that will benefit many others in the process, I
> would much rather adjust my strategies.

So would we ;)

> Wrong.  Phoenix will control the lifecyle of Catalina and all WARs within
> it.  I am simply offering a work interface that allows other SARs the
> capability to deploy/undeploy WARs specific to that SAR...at least that is
> the current interface ( posted a message to the Avalon-Phoenix Developers
> List earlier today discussing this).  WARs should be able to access the
> work interface for other SARs within Phoenix and utiltize their
> capabilities.

If you replace SAR with Block then I agree ;)

> More people use Servlets than use Phoenix and is therefore a recognized
> standard.  I can create a WAR that depends on other J2EE standard
> components, such as TransactionManagers, etc. configure the application
> server (Phoenix) to map its resources instances (SARs) into the JNDI
> namespace that the WAR searches, to supply that WAR with appropriate
> component implementations.  Many application servers offer additional
> "proprietary" funcationality.  This is my goal with Phoenix.  Create the
> ability to map Phoenix resources into the JNDI ENC of deployed WARs.

woohoo!

-- 
Cheers,

Peter Donald
----------------------------------------
"Liberty means responsibility. That is 
      why most men dread it." - Locke
---------------------------------------- 


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


Re: Phoenix and the Web

Posted by Peter Donald <pe...@apache.org>.
On Thu, 3 Oct 2002 01:24, Ulrich Mayring wrote:
> About Phoenix==>JNDI==>WAR - I see performance problems. I think this is
> workable only for infrequent communication, like configuring at startup.
> But providing a synchronous service over that link? Hmm....

There should be no performance problems *except* that the ContextClassLoader 
will have to be set when changing from WAR space to SAR space and back again.

JNDI is just a lookup service - you can quite easily do in process calls and 
in fact is the way that most (all?) EJBs implement local interfaces when they 
are integrated with a servlet engine.

-- 
Cheers,

Peter Donald
*---------------------------------------------------------*
| Contrary to popular belief, UNIX is user-friendly. It   |
| just happens to be selective on who it makes friendship |
| with.                                                   |
|                       - Richard Cook                    |
*---------------------------------------------------------* 


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


Re: Phoenix and the Web

Posted by Ulrich Mayring <ul...@denic.de>.
Daniel Krieg wrote:
 >
> I think we need a better specification for Sevak.  What is its purpose?  How
> should it interoperate with other apps.  Is it simply about embedding an
> existing Servlet Container within Phoenix or is it about creating an
> abstract container that can utilize implementations of existing containers?

I think the second option is more useful. I don't see any compelling 
advantage in running Catalina under Phoenix vs. stand-alone.

Whether Sevak should be an abstract container with many possible 
implementations or whether it should be a Catalina-specific container is 
not that important to me. If any features were lost when going abstract, 
I'd recommend staying close to Catalina. I don't think it is necessary 
to have several servlet engines under Phoenix, it would be enough to 
have just one, if that one works and allows for easy integration of 
Servlets with Phoenix apps. If other servlet engines were needed in the 
future, then another container similar to Sevak could be written. If, 
however, it is possible to go abstract without losing any features or 
ease of use, then that would be the way to go.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung


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


Re: Phoenix and the Web

Posted by Daniel Krieg <dk...@kc.rr.com>.
Peter,

>> How
>> does Phoenix's ClassLoader complicate modifying ClassLoader
>> hierarchies...what problems should I watch out for?

>Essentially the problem occurs when you try to have a Phoenix Block
implement
>part of Catalinas container. So for example if you wanted to use
Cornerstones
>SocketManager and expose it in Catalina. The Catalina class would have to
>have both the cornerstone/phoenix classes and the catalina classes.
>
>As standard hierarchies only allow one parent this is not possible unless
you
>expose Cornerstone/Phoenix to all of Catalina (including the webapps).
>However the servlet spec requires that webapps should not be able to see
the
>containers classloader.
So, a Web app should not have the Phoenix classloader in its heirarchy?

>
>Anyways thats why I am working on loader stuff to incorporate into Phoenix.
I looked at you loader stuff...very cool!

I think we need a better specification for Sevak.  What is its purpose?  How
should it interoperate with other apps.  Is it simply about embedding an
existing Servlet Container within Phoenix or is it about creating an
abstract container that can utilize implementations of existing containers?
I think in the long run, we need to define a complete set of services that
establish Sevak as a working interface specification and begin to adapt
existing containers to this specification.

Thoughts?


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


Re: Phoenix and the Web

Posted by Peter Donald <pe...@apache.org>.
Hi,

On Mon, 7 Oct 2002 22:48, Daniel Krieg wrote:
> The way I tackled this...a bit of a hack perhaps...is to use URLClassLoader
> to create a ClassLoader that points to Catalina's bootstrap.jar which
> contains Catalina's StandardClassLoader, load this class and create an
> instance of it (StandardClassLoader) using reflection, and establish the
> classpaths for this ClassLoader instance.  This seems to be working.  

Thats usually the standard way of doing something like this but ...

> How
> does Phoenix's ClassLoader complicate modifying ClassLoader
> hierarchies...what problems should I watch out for?

Essentially the problem occurs when you try to have a Phoenix Block implement 
part of Catalinas container. So for example if you wanted to use Cornerstones 
SocketManager and expose it in Catalina. The Catalina class would have to 
have both the cornerstone/phoenix classes and the catalina classes.

As standard hierarchies only allow one parent this is not possible unless you 
expose Cornerstone/Phoenix to all of Catalina (including the webapps). 
However the servlet spec requires that webapps should not be able to see the 
containers classloader. 

Anyways thats why I am working on loader stuff to incorporate into Phoenix.

-- 
Cheers,

Peter Donald
'Most men would rather die than think. Many do.'
                             Bertrand Russell


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


Re: Phoenix and the Web

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

>The way I tackled this...a bit of a hack perhaps...is to use URLClassLoader
>to create a ClassLoader that points to Catalina's bootstrap.jar which
>contains Catalina's StandardClassLoader, load this class and create an
>instance of it (StandardClassLoader) using reflection, and establish the
>classpaths for this ClassLoader instance.  This seems to be working.  How
>does Phoenix's ClassLoader complicate modifying ClassLoader
>hierarchies...what problems should I watch out for?
>
You have chosen a common strategy for complex classloader trees under 
Phoenix.  We may well provide a recommended solution of rt he same in 
the future, but for now that strategy is fine.  I have done the same 
with Enterprise Object Broker and Jesktop.

- Paul



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


Re: Phoenix and the Web

Posted by Daniel Krieg <dk...@kc.rr.com>.
Peter,

>> I am currently reworking some of my implementation of CatalinaSevak..
The
>> current version skips the Phoenix class loader and goes directly to the
>> SystemLoader.  This causes ClassLoader problems when other Blocks in the
>> same SAR try to interoperate.  I have modified my approach (use
>> PhoenixClassLoader) and seem to be able to create Avalon compliant
classes
>> to wrap the Catalina implementations.

>The problem is that Phoenix ClassLoader system does not allow you to easily
>modify ClassLoader hierarchies. I am currently in the process of adding in
>support for this and you can see the early documentation at
>which actually talks about setting up a ClassLoader hierarchy for a Servlet
>Container.
>Theres about 2-3 hours work left to finish off the implementation and test
>cases. However probably a bit more time to actually document it properly.
>Have a look at the web pages and tell me if they help you and if not - what
I
>need to do to make it easier to use/understand.
The way I tackled this...a bit of a hack perhaps...is to use URLClassLoader
to create a ClassLoader that points to Catalina's bootstrap.jar which
contains Catalina's StandardClassLoader, load this class and create an
instance of it (StandardClassLoader) using reflection, and establish the
classpaths for this ClassLoader instance.  This seems to be working.  How
does Phoenix's ClassLoader complicate modifying ClassLoader
hierarchies...what problems should I watch out for?

    private ClassLoader createClassLoader( File unpacked[], File packed[],
ClassLoader parent ) throws Exception {
        getLogger().debug( "Creating new class loader" );

        // Construct the "class path" for this class loader
...
        // Construct the class loader itself
        String[] classPath = (String[]) stringList.toArray( new String[
stringList.size() ] );
        URL[] urlArray = (URL[]) urlList.toArray( new URL[
urlList.size() ] );
        Class loaderClass = ( parent == null ) ?
URLClassLoader.newInstance( urlArray ).loadClass(
"org.apache.catalina.loader.StandardClassLoader" )
                : URLClassLoader.newInstance( urlArray,
parent ).loadClass( "org.apache.catalina.loader.StandardClassLoader" );

        getLogger().debug( loaderClass.getName() + " successfully
loaded." );
        Object loader = null;

        if( parent == null ) {
            loader = loaderClass.getConstructor( new
Class[]{classPath.getClass()} )
                    .newInstance( new Object[]{classPath} );
        } else {
            loader = loaderClass.getConstructor( new
Class[]{classPath.getClass(), ClassLoader.class} )
                    .newInstance( new Object[]{classPath, parent} );
        }

        getLogger().debug( "Setting loader to delegate=true" );
        Method delegating = loader.getClass().getMethod( "setDelegate", new
Class[]{Boolean.TYPE} );
        delegating.invoke( loader, new Object[]{Boolean.TRUE} );
        getLogger().debug( "Class Loader Intance: " + loader );

        getLogger().debug( "ClassLoader creation completed..." );
        return (ClassLoader) loader;


>>  In doing so, I must delegate the
>> lifecycle from one class to another, i.e. CatalinaSevak contains
>> CatalinaSevakServer contains CatalinaSevakService, etc.  Is it
>> common/accepted to allow this brand of containmnet within Avalon or is it
>> discouraged?

>I am not actually sure what you mean. Would you be able to point me at a
code
>snippet.
public class CatalinaSevakServer extends CatalinaSevakLogEnabled
            implements Lifecycle, Server, Configurable, Serviceable,
Startable
{
...
    private CatalinaSevakService m_service;
...
    public void configure(Configuration configuration) throws
ConfigurationException {
        getSevakLogger().debug("CatalinaSevakServer.configure()");
...
            Configuration[] children = m_configuration.getChildren();
            for (int i = 0; i < children.length; i++) {
                Configuration child = children[i];
                final String name = child.getName();
...
                } else if(name.equals("Service")) {
                    m_service = new CatalinaSevakService();
                    ContainerUtil.enableLogging(m_service,
getSevakLogger());
                    ContainerUtil.service(m_service, m_serviceManager);
                    ContainerUtil.configure(m_service, child);
                    m_service.setParentClassLoader(m_parentClassLoader);
                    addService(m_service);
                    getSevakLogger().debug("Service Added: " +
m_service.getName());
...
        getSevakLogger().debug("CatalinaSevakServer configured...");
    }





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


Re: Phoenix and the Web

Posted by Peter Donald <pe...@apache.org>.
On Sat, 5 Oct 2002 02:23, Daniel Krieg wrote:
> I am currently reworking some of my implementation of CatalinaSevak..  The
> current version skips the Phoenix class loader and goes directly to the
> SystemLoader.  This causes ClassLoader problems when other Blocks in the
> same SAR try to interoperate.  I have modified my approach (use
> PhoenixClassLoader) and seem to be able to create Avalon compliant classes
> to wrap the Catalina implementations.

The problem is that Phoenix ClassLoader system does not allow you to easily 
modify ClassLoader hierarchies. I am currently in the process of adding in 
support for this and you can see the early documentation at

http://jakarta.apache.org/avalon/excalibur/loader/index.html

You may want to look at the sample at 

http://jakarta.apache.org/avalon/excalibur/loader/sample.html

which actually talks about setting up a ClassLoader hierarchy for a Servlet 
Container.

Theres about 2-3 hours work left to finish off the implementation and test 
cases. However probably a bit more time to actually document it properly.

Have a look at the web pages and tell me if they help you and if not - what I 
need to do to make it easier to use/understand.

>  In doing so, I must delegate the
> lifecycle from one class to another, i.e. CatalinaSevak contains
> CatalinaSevakServer contains CatalinaSevakService, etc.  Is it
> common/accepted to allow this brand of containmnet within Avalon or is it
> discouraged?

I am not actually sure what you mean. Would you be able to point me at a code 
snippet.

> Catalina uses the Digester package to parse the server.xml.  The current
> CatalinaSevak implementation has copy/paste code to allow the parsing of
> this file.  I am now reimplementing this aspect and am confident that I
> will be able to use the Configuration class that comes with Avalon (I have
> tested and succeeded with this!) to bootstrap the entire server. 

kool!

> This will
> additionally allow me to wrap all Catalina implementation with Avalon.  If
> I am successful, all Blocks within this SAR should be interoperable, right?

I think so ;)

-- 
Cheers,

Peter Donald
----------------------------------------
Whatever you do will be insignificant, 
but it is very important that you do it. 
                              --Gandhi
---------------------------------------- 


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


Re: Phoenix and the Web

Posted by Daniel Krieg <dk...@kc.rr.com>.
Peter, et.al.,

I am currently reworking some of my implementation of CatalinaSevak..  The
current version skips the Phoenix class loader and goes directly to the
SystemLoader.  This causes ClassLoader problems when other Blocks in the
same SAR try to interoperate.  I have modified my approach (use
PhoenixClassLoader) and seem to be able to create Avalon compliant classes
to wrap the Catalina implementations.  In doing so, I must delegate the
lifecycle from one class to another, i.e. CatalinaSevak contains
CatalinaSevakServer contains CatalinaSevakService, etc.  Is it
common/accepted to allow this brand of containmnet within Avalon or is it
discouraged?

>On Thu, 3 Oct 2002 21:19, Daniel Krieg wrote:
>> The strategy I took in implementing CatalinaSevak was to try
>> to replicate a standard installation of Catalina so that anyone familiar
>> with Catalina administration would be able to maintain CatalinSevak.  Is
>> this strategy acceptable in the long run with respect to Phoenix or
should
>> this SAR have a separate configuration/administration semantics?

>I think thats the way to go. In the future we may want to integrate them
more
>(or we may not) but it would be best to be able to work of a standard
>Catalina (or Jo or Jetty) because that way we get all the features of the
>servlet engine without trying to figure out a way to have some common
>configuration format or whatever.
>
>--
>Cheers,
>
>Peter Donald
Catalina uses the Digester package to parse the server.xml.  The current
CatalinaSevak implementation has copy/paste code to allow the parsing of
this file.  I am now reimplementing this aspect and am confident that I will
be able to use the Configuration class that comes with Avalon (I have tested
and succeeded with this!) to bootstrap the entire server.  This will
additionally allow me to wrap all Catalina implementation with Avalon.  If I
am successful, all Blocks within this SAR should be interoperable, right?


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


Re: Phoenix and the Web

Posted by Peter Donald <pe...@apache.org>.
On Fri, 4 Oct 2002 10:38, Peter Royal wrote:
> wrt the Block vs SAR, I would like to have a way to have dependencies
> between SARs. It could be thought of as a Phoenix-in-Phoenix, just
> moving up one level from Block and App to App and Partition (or some
> other word).
>
> With CatalinaSevak running as a SAR, I would like to be able to deploy
> multiple other SARs in a single Phoenix instance that deploy a UI via a
> WAR using Sevak. I would follow Paul's thoughts on communication, using
> AltRMI or the like so that for scalability the SAR could be deployed in
> a remote phoenix instance.

It is definetly a good idea. However it kinda requires a largish bunch of 
changes - most drastic being ClassLoader changes and isolation changes (ie 
jprocess and loader projects in excalibur). I keep putting off finishing the 
loader stuff in excalibur because it requires so many damn unit tests ;)

Though hopefully it will be done sooner rather than later.

> Perhaps ContainerKit can make this all possible.. an xinfo for a SAR :)

ContainerKit probably couldn't but Info may ;)

-- 
Cheers,

Peter Donald
-----------------------------------------------------------
 Don't take life too seriously -- 
                          you'll never get out of it alive.
-----------------------------------------------------------


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


Re: Phoenix and the Web

Posted by Ulrich Mayring <ul...@denic.de>.
Peter Royal wrote:
> 
> wrt the Block vs SAR, I would like to have a way to have dependencies 
> between SARs. It could be thought of as a Phoenix-in-Phoenix, just 
> moving up one level from Block and App to App and Partition (or some 
> other word).

This breaks IoC again :)

IoC is not a virtue by itself, it has a distinct purpose. It is, amongst 
other things, a design pattern that should prevent complexity by 
offering one-way interfaces. If there is a single, defined way to use a 
component, then it is much easier to maintain these interfaces across 
versions. Think of SAP hell, if you wonder what happens when there are 
too many interfaces :)

> With CatalinaSevak running as a SAR, I would like to be able to deploy 
> multiple other SARs in a single Phoenix instance that deploy a UI via a 
> WAR using Sevak. I would follow Paul's thoughts on communication, using 
> AltRMI or the like so that for scalability the SAR could be deployed in 
> a remote phoenix instance.

A SAR can already deploy and undeploy other SARs, but it has to use the 
defined interface (JMX) and be aware of security issues. I cannot fathom 
why a SAR deploying other SARs is useful in any way, but there is an 
interface out there that allows it. Why not use it instead of developing 
a new one? If the existing interface is not good enough, then let's 
improve it :)

cheers,

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung


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


Re: Phoenix and the Web

Posted by Peter Royal <pr...@apache.org>.
On Thursday, October 3, 2002, at 07:43  PM, Peter Donald wrote:
> On Thu, 3 Oct 2002 21:19, Daniel Krieg wrote:
>> The strategy I took in implementing CatalinaSevak was to try
>> to replicate a standard installation of Catalina so that anyone 
>> familiar
>> with Catalina administration would be able to maintain CatalinSevak.  
>> Is
>> this strategy acceptable in the long run with respect to Phoenix or 
>> should
>> this SAR have a separate configuration/administration semantics?
>
> I think thats the way to go. In the future we may want to integrate 
> them more
> (or we may not) but it would be best to be able to work of a standard
> Catalina (or Jo or Jetty) because that way we get all the features of 
> the
> servlet engine without trying to figure out a way to have some common
> configuration format or whatever.

+1.

wrt the Block vs SAR, I would like to have a way to have dependencies 
between SARs. It could be thought of as a Phoenix-in-Phoenix, just 
moving up one level from Block and App to App and Partition (or some 
other word).

With CatalinaSevak running as a SAR, I would like to be able to deploy 
multiple other SARs in a single Phoenix instance that deploy a UI via a 
WAR using Sevak. I would follow Paul's thoughts on communication, using 
AltRMI or the like so that for scalability the SAR could be deployed in 
a remote phoenix instance.

Perhaps ContainerKit can make this all possible.. an xinfo for a SAR :)
-pete


-- 
peter royal -> proyal@apache.org


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


Re: Phoenix and the Web

Posted by Peter Donald <pe...@apache.org>.
On Thu, 3 Oct 2002 21:19, Daniel Krieg wrote:
> The strategy I took in implementing CatalinaSevak was to try
> to replicate a standard installation of Catalina so that anyone familiar
> with Catalina administration would be able to maintain CatalinSevak.  Is
> this strategy acceptable in the long run with respect to Phoenix or should
> this SAR have a separate configuration/administration semantics?

I think thats the way to go. In the future we may want to integrate them more 
(or we may not) but it would be best to be able to work of a standard 
Catalina (or Jo or Jetty) because that way we get all the features of the 
servlet engine without trying to figure out a way to have some common 
configuration format or whatever.

-- 
Cheers,

Peter Donald
----------------------------------------
Whatever you do will be insignificant, 
but it is very important that you do it. 
                              --Gandhi
---------------------------------------- 


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


Re: Phoenix and the Web

Posted by Paul Hammant <Pa...@yahoo.com>.
Daniel,

OK, you need to make the blocks available to your client webapps.

I think you'll have problems with classloaders.  I say this because you 
hope to get one block to register inserf in JNDI, and a WAR file app to 
pull the think from JNDI and cast it to an interface.  I suggest that 
you'll get a classcast exception because of the multiple classloaders 
involved.

You might find it best to use Cornerstone's publisher or autopublisher 
to publish a block via AltRMI.  In the servlet webapp use AltRMI's 
client to lookup the implementation.  Currently this will happen over 
sockets, getting round the classloader/classcast issue, but in time I 
will go back to AltRMI and allow an optimized lookup (a la WebLogic).

Regards,

- Paul

>All,
>
>This discussion about SARs and Blocks has been very informative to me.  What
>I am writing for my client is a single application (SAR) with multiple
>Blocks which utilize the service of other Blocks...that is very clear to me
>now.  I need to make the other Blocks available to Webapps and plan to do so
>via JNDI.  The strategy I took in implementing CatalinaSevak was to try to
>replicate a standard installation of Catalina so that anyone familiar with
>Catalina administration would be able to maintain CatalinSevak.  Is this
>strategy acceptable in the long run with respect to Phoenix or should this
>SAR have a separate configuration/administration semantics?
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>  
>




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


Re: Phoenix and the Web

Posted by Daniel Krieg <dk...@kc.rr.com>.
All,

This discussion about SARs and Blocks has been very informative to me.  What
I am writing for my client is a single application (SAR) with multiple
Blocks which utilize the service of other Blocks...that is very clear to me
now.  I need to make the other Blocks available to Webapps and plan to do so
via JNDI.  The strategy I took in implementing CatalinaSevak was to try to
replicate a standard installation of Catalina so that anyone familiar with
Catalina administration would be able to maintain CatalinSevak.  Is this
strategy acceptable in the long run with respect to Phoenix or should this
SAR have a separate configuration/administration semantics?


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


Re: Phoenix and the Web

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

My take is that the Sevak interface (multihost or not) should provide 
essentially two methods for other blocks :

  deploy(host, context, WarFile-Or-War-Directory)
  undeploy(host, context)

If web applications hosted inside the particular Sevak impl need to 
access any other services hosted in the same JVM (blocks etc), they must 
do it via RMI/AltRMI or JNDI.  That thing will be a narowed servce like 
"StockQuoteFacade"

If the Sevak impl needs to avail of other blocks itself, then it should 
be written or rewrapped as a Servicable block and use service(..) to 
lookup the required components.

Given that we are wrapping all three containers, we know they are doing 
some dirty un-IoC stuff in their own impementation.  We can;t control 
that, and just have to live with it.  We can however not encourage 
futher damage, by limiting what the container exposes to other blocks.

On the subject of the management webapp or other applications deployed 
with Catalina, perhaps they should be taken out of the default 
Sevak-Catalina impl and put into an alternativel block called 
AdministratableCatalinaSevak or somesuch.  It extends CatalinaSevak. 
 The assembler chooses which one they deploy.

Thoughs?

Regards,

- Paul

>Ulrich,
>
>  
>
>>Blocks can have dependencies on other blocks, when they are assembled in
>>one SAR. That is ok and does not break IOC, because Phoenix doesn't
>>control individual blocks, it controls SARs. However, when SARs start to
>>control other SARs, I think IoC is broken.
>>    
>>
>The light goes ON!!!  I have been thinking too narrow and have been
>discussing Blocks rather than SARs.  I should probably go back and review
>our entire discussion...but too lazy/not enough time in a day.  How do SARs
>communicate with other SARs?  Through JMX?  Lets say we are implementing
>J2EE application server...how does the EJB Container (SAR) expose its
>components to the Web Container (SAR)?  Thus far I have thinking of the
>entire J2EE server as one large component (SAR) with multiple interacting
>Blocks (Sevak)
>
>As such, the way I have implemented Catalina Sevak does not need to expose
>any work interface to other Blocks...in fact no other Blocks are necessary.
>Have you (or anyone else) examined the Catalina Sevak implementation?  I
>just now looked at Jo and Jetty...they are quite simple in implementation in
>comparison.  Have I taken a completely errant path?
>
>Daniel
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>  
>




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


Re: Phoenix and the Web

Posted by Daniel Krieg <dk...@kc.rr.com>.
Ulrich,

> Blocks can have dependencies on other blocks, when they are assembled in
> one SAR. That is ok and does not break IOC, because Phoenix doesn't
> control individual blocks, it controls SARs. However, when SARs start to
> control other SARs, I think IoC is broken.
The light goes ON!!!  I have been thinking too narrow and have been
discussing Blocks rather than SARs.  I should probably go back and review
our entire discussion...but too lazy/not enough time in a day.  How do SARs
communicate with other SARs?  Through JMX?  Lets say we are implementing
J2EE application server...how does the EJB Container (SAR) expose its
components to the Web Container (SAR)?  Thus far I have thinking of the
entire J2EE server as one large component (SAR) with multiple interacting
Blocks (Sevak)

As such, the way I have implemented Catalina Sevak does not need to expose
any work interface to other Blocks...in fact no other Blocks are necessary.
Have you (or anyone else) examined the Catalina Sevak implementation?  I
just now looked at Jo and Jetty...they are quite simple in implementation in
comparison.  Have I taken a completely errant path?

Daniel


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


Re: Phoenix and the Web

Posted by Ulrich Mayring <ul...@denic.de>.
Daniel Krieg wrote:
> 
> I agree.  However, within Phoenix, SARs can have dependencies on other SARs,
> can access these SARs from the ServiceManger which is supplied in the
> service method, and can utilize these other SARs to perform their work
> interface.  This is not counter to IoC.

Blocks can have dependencies on other blocks, when they are assembled in 
one SAR. That is ok and does not break IOC, because Phoenix doesn't 
control individual blocks, it controls SARs. However, when SARs start to 
control other SARs, I think IoC is broken.

> Wrong.  Phoenix will control the lifecyle of Catalina and all WARs within
> it.  I am simply offering a work interface that allows other SARs the
> capability to deploy/undeploy WARs specific to that SAR...at least that is
> the current interface ( posted a message to the Avalon-Phoenix Developers
> List earlier today discussing this).  WARs should be able to access the work
> interface for other SARs within Phoenix and utiltize their capabilities.

Hm, for me one of the cool features of Avalon/Phoenix is that SARs do 
*not* depend on other SARs and one malfunctioning SAR cannot cripple 
another one.

Somehow I don't like the idea of a SAR undeploying a component that 
belongs to another SAR.

> What I have done with Catalina Sevak is to have its lifecycle determined by
> Phoenix, managable through Phoenix's MX4J HTTPConnector, and provides the
> full functionality of Tomcat except its own server start/stop sequence.

I think that is reasonable. You are controlling a WARs lifecycle through 
Phoenix's lifecycle, this does not break IoC, it's just a mapping.

> More people use Servlets than use Phoenix and is therefore a recognized
> standard.

Absolutely.

 > I can create a WAR that depends on other J2EE standard
> components, such as TransactionManagers, etc. configure the application
> server (Phoenix) to map its resources instances (SARs) into the JNDI
> namespace that the WAR searches, to supply that WAR with appropriate
> component implementations.  Many application servers offer additional
> "proprietary" funcationality.  This is my goal with Phoenix.  Create the
> ability to map Phoenix resources into the JNDI ENC of deployed WARs.

I'm not saying these proprietary extensions are bad, I'm just saying 
they are not a standard in the same way that an alternate Servlet API is 
not a standard. It's also just a proprietary extension.

About Phoenix==>JNDI==>WAR - I see performance problems. I think this is 
workable only for infrequent communication, like configuring at startup. 
But providing a synchronous service over that link? Hmm....

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung


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


Re: Phoenix and the Web

Posted by Daniel Krieg <dk...@kc.rr.com>.
Ulrich,

First of all I would like to thankyou for your input.  I am currently
working on a specific project and can easily "HACK" together a solution that
might not necessarily be the best design for standard use.  If I am able to
create something that will benefit many others in the process, I would much
rather adjust my strategies.

> Ok, the motto of IoC in the Avalon world is: don't ask how your
> component can call Avalon, have Avalon call your component. So I think
> the WARs shouldn't be able to do anything to Avalon/Phoenix, instead
> they should rely on the fact that some of their methods will be called
> by Avalon/Phoenix. Therefore, those AWARs (Avalonized WARs) should have
> methods that are invoked by Avalon's lifecycle mechanism. Depending on
> how you want to do it they would be called deploy/undeploy or start/stop
> or pause/resume.
I agree.  However, within Phoenix, SARs can have dependencies on other SARs,
can access these SARs from the ServiceManger which is supplied in the
service method, and can utilize these other SARs to perform their work
interface.  This is not counter to IoC.

>
> If I understood you correctly you don't want Avalon's lifecycle
> mechanism in control of the WARs, rather you want to give the Avalon
> user the power to control Catalina's lifecycle mechanism arbitrarily.
>
> Furthermore you seem to want control in the other direction, too. Please
> correct me if I'm wrong, but your example said that a SAR controls a
> hardware resource and a WAR should control the SAR.
>
Wrong.  Phoenix will control the lifecyle of Catalina and all WARs within
it.  I am simply offering a work interface that allows other SARs the
capability to deploy/undeploy WARs specific to that SAR...at least that is
the current interface ( posted a message to the Avalon-Phoenix Developers
List earlier today discussing this).  WARs should be able to access the work
interface for other SARs within Phoenix and utiltize their capabilities.

> > You could do everything with JMX...no need for Avalon framework
then...just
> > look at JBoss!  I would much rather program to compile-time checked
> > interfaces that pass around ObjectNames any day.
>
> What I meant: if you need a management console for a SAR, it would be
> much easier to do it with JMX. I did not mean that WAR<==>SAR
> communication would be easier with JMX.
I totally agree.

> Both frameworks have their advantages - Avalon has a cool lifecycle,
> Catalina has a cool web container. But Avalon also has *some* web
> container (e.g. MX4J HTTPConnector) and Catalina also has *some*
> lifecycle. So I do not see any principal difference between the two.
I think that the principle difference between the two is the type of
component that each can manage.  Within Phoenix, we can create components
that offer totally unique work interfaces, which clients i.e. other SARs,
can lookup using ServiceManager and invoke.  Within Catalina, the work
interface can never truly be more than that of a Servlet, which does not
allow clients, other Servlets, to access directly by interface.

>
> > Why do we need to change anything semantically?  What is inheriantly
wrong
> > with the current state of Web Containers???  Far more reliable than GOTO
> > statements!
>
> What I meant: if we write wrappers around Catalina's lifecycle methods,
> we don't get Avalon's lifecycle mechanism. It would be cleaner (but
> maybe technically impossible?) to get rid of Catalina's lifecycle
> altogether in favor of Avalon's and just use Catalina's web container
> functionality.
What I have done with Catalina Sevak is to have its lifecycle determined by
Phoenix, managable through Phoenix's MX4J HTTPConnector, and provides the
full functionality of Tomcat except its own server start/stop sequence.  I
accomplished this by writing a class that is Avalon based which delegates to
objects that wrap Catalina objects.  As the Avalon-based object move through
its lifecycle, it delegates the lifecycle to Catalina through the wrappers.



> > You want to rewrite the Servlet's API to Avalonize it?  Could easily be
> > done...but would always be a non-standard technology.
>
> Not less of a standard than Avalon itself. There is no way you can take
> a SAR and run it outside of Avalon/Phoenix. In your design it's not
> possible either and also your WARs won't run without Phoenix :)
More people use Servlets than use Phoenix and is therefore a recognized
standard.  I can create a WAR that depends on other J2EE standard
components, such as TransactionManagers, etc. configure the application
server (Phoenix) to map its resources instances (SARs) into the JNDI
namespace that the WAR searches, to supply that WAR with appropriate
component implementations.  Many application servers offer additional
"proprietary" funcationality.  This is my goal with Phoenix.  Create the
ability to map Phoenix resources into the JNDI ENC of deployed WARs.






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


Re: Phoenix and the Web

Posted by Ulrich Mayring <ul...@denic.de>.
Daniel Krieg wrote:
> 
> 
>>Hmm... not sure about that one. Do we really want to write a management
> console
>>for Catalina? Also, it breaks IoC, doesn't it?
> 
> Catalina already has a management console, we would simply be allowing
> clients to invoke without being tightly bound to Catalina.  Breaks
> IoC...really?...how?

First of all, sorry for the ugly formatting, I hope I fixed it now.

Ok, the motto of IoC in the Avalon world is: don't ask how your 
component can call Avalon, have Avalon call your component. So I think 
the WARs shouldn't be able to do anything to Avalon/Phoenix, instead 
they should rely on the fact that some of their methods will be called 
by Avalon/Phoenix. Therefore, those AWARs (Avalonized WARs) should have 
methods that are invoked by Avalon's lifecycle mechanism. Depending on 
how you want to do it they would be called deploy/undeploy or start/stop 
or pause/resume.

If I understood you correctly you don't want Avalon's lifecycle 
mechanism in control of the WARs, rather you want to give the Avalon 
user the power to control Catalina's lifecycle mechanism arbitrarily.

Furthermore you seem to want control in the other direction, too. Please 
correct me if I'm wrong, but your example said that a SAR controls a 
hardware resource and a WAR should control the SAR.

>>You could do that with JMX much, much easier.
> 
> You could do everything with JMX...no need for Avalon framework then...just
> look at JBoss!  I would much rather program to compile-time checked
> interfaces that pass around ObjectNames any day.

What I meant: if you need a management console for a SAR, it would be 
much easier to do it with JMX. I did not mean that WAR<==>SAR 
communication would be easier with JMX.

> I disagree.  Catalina is a Container that manages the lifecycle of Servlet
> instances.  Phoenix is a Container that can manages the lifecycle of
> Avalon-based instances--who have a much richer set of lifecycle methods than
> Servlets.

Both frameworks have their advantages - Avalon has a cool lifecycle, 
Catalina has a cool web container. But Avalon also has *some* web 
container (e.g. MX4J HTTPConnector) and Catalina also has *some* 
lifecycle. So I do not see any principal difference between the two.

> Why do we need to change anything semantically?  What is inheriantly wrong
> with the current state of Web Containers???  Far more reliable than GOTO
> statements!

What I meant: if we write wrappers around Catalina's lifecycle methods, 
we don't get Avalon's lifecycle mechanism. It would be cleaner (but 
maybe technically impossible?) to get rid of Catalina's lifecycle 
altogether in favor of Avalon's and just use Catalina's web container 
functionality.

> You want to rewrite the Servlet's API to Avalonize it?  Could easily be
> done...but would always be a non-standard technology.

Not less of a standard than Avalon itself. There is no way you can take 
a SAR and run it outside of Avalon/Phoenix. In your design it's not 
possible either and also your WARs won't run without Phoenix :)

>>Really? I couldn't find anything in the docs. Maybe in CVS?
> 
> I checked...it is in the Cornerstone project...ConnectionManager and
> SocketManager components.

Ah ok, I know about that one. I misunderstood you and thought you were 
talking about special-purpose Web components. Of course I can always 
open a socket on port 80 and speak HTTP.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung


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


Re: Phoenix and the Web

Posted by Daniel Krieg <dk...@kc.rr.com>.
Ulrich,

>  > I imagine that other components
> > might require the ability to deploy web applications, create custom
Service
> > blocks within the web server, start/stop these service blocks, etc.
>
> Hmm... not sure about that one. Do we really want to write a management
console
> for Catalina? Also, it breaks IoC, doesn't it?
Catalina already has a management console, we would simply be allowing
clients to invoke without being tightly bound to Catalina.  Breaks
IoC...really?...how?

>
>  > For
> > example, say that I have created a phoenix service that controls an
external
> > hardware resource and want to be able to manipulate that service via a
web
> > application.  I would need to create a block that depends on Sevak and
has
> > the ability to specify a webapp Context that contains references back to
> > itself, and to specify which Host within Sevak this webapp should be
> > deployed to.
>
> You could do that with JMX much, much easier.
You could do everything with JMX...no need for Avalon framework then...just
look at JBoss!  I would much rather program to compile-time checked
interfaces that pass around ObjectNames any day.

>
> > Phoenix is an application server kernel...utilizing Phoenix as a
component
> > embedded within a Web Container does not make much sense.
>
> Catalina is also an application server kernel embedded within a Web
Container.
I disagree.  Catalina is a Container that manages the lifecycle of Servlet
instances.  Phoenix is a Container that can manages the lifecycle of
Avalon-based instances--who have a much richer set of lifecycle methods than
Servlets.

>
> > If they won't componentize their design, we must create abstract
wrappers to
> > adapt the two.
>
> The problem I see is that we don't change anything semantically by writing
> wrappers. You can wrap a GOTO statement in XML syntax, but it's still a
GOTO.
> Maybe I'm being overly pessimistic here :)
Why do we need to change anything semantically?  What is inheriantly wrong
with the current state of Web Containers???  Far more reliable than GOTO
statements!


>
> >>3) How about an ajpv12 or ajpv13 component?
>
> > You lost me here...what is the advantage?
>
> A Phoenix application can then act as backend to every webserver that
supports
> ajpv13 without the need for an intermittent Servlet Server. So this is
going to
> run on many platforms, not just a specific Servlet Server like Catalina.
Plus,
> it might be the easiest route, because the source code could be nicked
from mod_jk.
You want to rewrite the Servlet's API to Avalonize it?  Could easily be
done...but would always be a non-standard technology.

>
> > If you are looking for a way to provide web access via Sockets, I
believe
> > such components exist within Excalibur that can be used within Phoenix.
>
> Really? I couldn't find anything in the docs. Maybe in CVS?
I checked...it is in the Cornerstone project...ConnectionManager and
SocketManager components.


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


Re: Phoenix and the Web

Posted by Ilia Iourovitski <ii...@yahoo.com>.
Try to look at JBoss & Jetty integration.

Ilia
--- Ulrich Mayring <ul...@denic.de> wrote:
> Daniel Krieg wrote:
> > Ulrich ,
> > 
> > I am currently working on Catalina Sevak.  The
> current project that I am
> > working on consists of a series of services to be
> deployed into Phoenix.  I
> > must be able to allow webapps to access these
> other services...a requirement
> > not yet implemented by Sevak.  Addtionally I may
> need to allow these
> > services to update/add/remove webapps that are
> currently deployed.  The
> > approach that I have taken so far is to create
> Avalon-based classes to
> > implement the required interfaces and have these
> classes dynamically
> > delegate to Tomcat-based classes using reflection.
>  Thus far I have
> > implemented a bootstrap mechanism that replicates
> the Tomcat startup script
> > and a custom Catalina Server implementation the
> eliminates the standard
> > socket-based shutdown used by Tomcat.  My goal is
> to eventually have a
> > custom Context class that delegates to Tomcat's
> StandardContext, adding
> > functionality as needed.  One such instance is in
> creating the
> > ServletContext.  By implementing this custom
> Context, I hope to be able to
> > set things like the ServiceManager into the
> ServletContext as an
> > attribute...what do you think?
> 
> I'm not sure, what is the exact interface between
> Catalina and Avalon? And is 
> this stuff maintainable entirely within
> Avalon/Phoenix or can it break, when 
> something changes in Catalina?
> 
> > I think that Web application components would like
> to be able to access and
> > utilize the services of other components within
> Phoenix as if the Web
> > application was itself a phoenix component.
> 
> Agreed.
> 
>  > I imagine that other components
> > might require the ability to deploy web
> applications, create custom Service
> > blocks within the web server, start/stop these
> service blocks, etc.
> 
> Hmm... not sure about that one. Do we really want to
> write a management console 
> for Catalina? Also, it breaks IoC, doesn't it?
> 
>  > For
> > example, say that I have created a phoenix service
> that controls an external
> > hardware resource and want to be able to
> manipulate that service via a web
> > application.  I would need to create a block that
> depends on Sevak and has
> > the ability to specify a webapp Context that
> contains references back to
> > itself, and to specify which Host within Sevak
> this webapp should be
> > deployed to.
> 
> You could do that with JMX much, much easier.
> 
> > Phoenix is an application server
> kernel...utilizing Phoenix as a component
> > embedded within a Web Container does not make much
> sense.
> 
> Catalina is also an application server kernel
> embedded within a Web Container.
> 
> > If they won't componentize their design, we must
> create abstract wrappers to
> > adapt the two.
> 
> The problem I see is that we don't change anything
> semantically by writing 
> wrappers. You can wrap a GOTO statement in XML
> syntax, but it's still a GOTO. 
> Maybe I'm being overly pessimistic here :)
> 
> >>3) How about an ajpv12 or ajpv13 component?
> 
> > You lost me here...what is the advantage?
> 
> A Phoenix application can then act as backend to
> every webserver that supports 
> ajpv13 without the need for an intermittent Servlet
> Server. So this is going to 
> run on many platforms, not just a specific Servlet
> Server like Catalina. Plus, 
> it might be the easiest route, because the source
> code could be nicked from mod_jk.
> 
> > If you are looking for a way to provide web access
> via Sockets, I believe
> > such components exist within Excalibur that can be
> used within Phoenix.
> 
> Really? I couldn't find anything in the docs. Maybe
> in CVS?
> 
> cheers,
> 
> Ulrich
> 
> -- 
> Ulrich Mayring
> DENIC eG, Systementwicklung
> 
> 
> --
> To unsubscribe, e-mail:  
>
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

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


Re: Phoenix and the Web

Posted by Ilia Iourovitski <ii...@yahoo.com>.
Try to look at JBooss & Jetty integration.

Ilia
--- Ulrich Mayring <ul...@denic.de> wrote:
> Daniel Krieg wrote:
> > Ulrich ,
> > 
> > I am currently working on Catalina Sevak.  The
> current project that I am
> > working on consists of a series of services to be
> deployed into Phoenix.  I
> > must be able to allow webapps to access these
> other services...a requirement
> > not yet implemented by Sevak.  Addtionally I may
> need to allow these
> > services to update/add/remove webapps that are
> currently deployed.  The
> > approach that I have taken so far is to create
> Avalon-based classes to
> > implement the required interfaces and have these
> classes dynamically
> > delegate to Tomcat-based classes using reflection.
>  Thus far I have
> > implemented a bootstrap mechanism that replicates
> the Tomcat startup script
> > and a custom Catalina Server implementation the
> eliminates the standard
> > socket-based shutdown used by Tomcat.  My goal is
> to eventually have a
> > custom Context class that delegates to Tomcat's
> StandardContext, adding
> > functionality as needed.  One such instance is in
> creating the
> > ServletContext.  By implementing this custom
> Context, I hope to be able to
> > set things like the ServiceManager into the
> ServletContext as an
> > attribute...what do you think?
> 
> I'm not sure, what is the exact interface between
> Catalina and Avalon? And is 
> this stuff maintainable entirely within
> Avalon/Phoenix or can it break, when 
> something changes in Catalina?
> 
> > I think that Web application components would like
> to be able to access and
> > utilize the services of other components within
> Phoenix as if the Web
> > application was itself a phoenix component.
> 
> Agreed.
> 
>  > I imagine that other components
> > might require the ability to deploy web
> applications, create custom Service
> > blocks within the web server, start/stop these
> service blocks, etc.
> 
> Hmm... not sure about that one. Do we really want to
> write a management console 
> for Catalina? Also, it breaks IoC, doesn't it?
> 
>  > For
> > example, say that I have created a phoenix service
> that controls an external
> > hardware resource and want to be able to
> manipulate that service via a web
> > application.  I would need to create a block that
> depends on Sevak and has
> > the ability to specify a webapp Context that
> contains references back to
> > itself, and to specify which Host within Sevak
> this webapp should be
> > deployed to.
> 
> You could do that with JMX much, much easier.
> 
> > Phoenix is an application server
> kernel...utilizing Phoenix as a component
> > embedded within a Web Container does not make much
> sense.
> 
> Catalina is also an application server kernel
> embedded within a Web Container.
> 
> > If they won't componentize their design, we must
> create abstract wrappers to
> > adapt the two.
> 
> The problem I see is that we don't change anything
> semantically by writing 
> wrappers. You can wrap a GOTO statement in XML
> syntax, but it's still a GOTO. 
> Maybe I'm being overly pessimistic here :)
> 
> >>3) How about an ajpv12 or ajpv13 component?
> 
> > You lost me here...what is the advantage?
> 
> A Phoenix application can then act as backend to
> every webserver that supports 
> ajpv13 without the need for an intermittent Servlet
> Server. So this is going to 
> run on many platforms, not just a specific Servlet
> Server like Catalina. Plus, 
> it might be the easiest route, because the source
> code could be nicked from mod_jk.
> 
> > If you are looking for a way to provide web access
> via Sockets, I believe
> > such components exist within Excalibur that can be
> used within Phoenix.
> 
> Really? I couldn't find anything in the docs. Maybe
> in CVS?
> 
> cheers,
> 
> Ulrich
> 
> -- 
> Ulrich Mayring
> DENIC eG, Systementwicklung
> 
> 
> --
> To unsubscribe, e-mail:  
>
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

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


Re: Phoenix and the Web

Posted by Ulrich Mayring <ul...@denic.de>.
Daniel Krieg wrote:
> Ulrich ,
> 
> I am currently working on Catalina Sevak.  The current project that I am
> working on consists of a series of services to be deployed into Phoenix.  I
> must be able to allow webapps to access these other services...a requirement
> not yet implemented by Sevak.  Addtionally I may need to allow these
> services to update/add/remove webapps that are currently deployed.  The
> approach that I have taken so far is to create Avalon-based classes to
> implement the required interfaces and have these classes dynamically
> delegate to Tomcat-based classes using reflection.  Thus far I have
> implemented a bootstrap mechanism that replicates the Tomcat startup script
> and a custom Catalina Server implementation the eliminates the standard
> socket-based shutdown used by Tomcat.  My goal is to eventually have a
> custom Context class that delegates to Tomcat's StandardContext, adding
> functionality as needed.  One such instance is in creating the
> ServletContext.  By implementing this custom Context, I hope to be able to
> set things like the ServiceManager into the ServletContext as an
> attribute...what do you think?

I'm not sure, what is the exact interface between Catalina and Avalon? And is 
this stuff maintainable entirely within Avalon/Phoenix or can it break, when 
something changes in Catalina?

> I think that Web application components would like to be able to access and
> utilize the services of other components within Phoenix as if the Web
> application was itself a phoenix component.

Agreed.

 > I imagine that other components
> might require the ability to deploy web applications, create custom Service
> blocks within the web server, start/stop these service blocks, etc.

Hmm... not sure about that one. Do we really want to write a management console 
for Catalina? Also, it breaks IoC, doesn't it?

 > For
> example, say that I have created a phoenix service that controls an external
> hardware resource and want to be able to manipulate that service via a web
> application.  I would need to create a block that depends on Sevak and has
> the ability to specify a webapp Context that contains references back to
> itself, and to specify which Host within Sevak this webapp should be
> deployed to.

You could do that with JMX much, much easier.

> Phoenix is an application server kernel...utilizing Phoenix as a component
> embedded within a Web Container does not make much sense.

Catalina is also an application server kernel embedded within a Web Container.

> If they won't componentize their design, we must create abstract wrappers to
> adapt the two.

The problem I see is that we don't change anything semantically by writing 
wrappers. You can wrap a GOTO statement in XML syntax, but it's still a GOTO. 
Maybe I'm being overly pessimistic here :)

>>3) How about an ajpv12 or ajpv13 component?

> You lost me here...what is the advantage?

A Phoenix application can then act as backend to every webserver that supports 
ajpv13 without the need for an intermittent Servlet Server. So this is going to 
run on many platforms, not just a specific Servlet Server like Catalina. Plus, 
it might be the easiest route, because the source code could be nicked from mod_jk.

> If you are looking for a way to provide web access via Sockets, I believe
> such components exist within Excalibur that can be used within Phoenix.

Really? I couldn't find anything in the docs. Maybe in CVS?

cheers,

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung


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


Re: Phoenix and the Web

Posted by Daniel Krieg <dk...@kc.rr.com>.
>Another option would be to expose Avalon components as JNDI resources. That
>way you follow the "standard" for providing extra behaviour.
Yes, this seems much more reasonable.  I've been thinking about what the
responsibilities of a web component should be...and it is precisely that, to
map resources, EJBs, security, etc. declared in the web.xml to those service
offerings in Phoenix.

Oh, and BTW...those interested in the Catalina Sevak project.  If you modify
the src/demo/catalina-config.xml to
<config-file>conf/server.xml</config-file>, install, and run
Phoenix...Catalina's JNDI naming service works like a charm, MBeans too!




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


Re: Phoenix and the Web

Posted by Peter Donald <pe...@apache.org>.
On Mon, 30 Sep 2002 21:18, Daniel Krieg wrote:
> By implementing this custom Context, I hope to be able to
> set things like the ServiceManager into the ServletContext as an
> attribute...what do you think?

+1

Another option would be to expose Avalon components as JNDI resources. That 
way you follow the "standard" for providing extra behaviour.

-- 
Cheers,

Peter Donald
*-----------------------------------------------------*
| Never argue with an idiot, they'll drag you down to |
| their level, and beat you with experience           |
*-----------------------------------------------------* 


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


Re: Phoenix and the Web

Posted by Daniel Krieg <dk...@kc.rr.com>.
Ulrich ,

I am currently working on Catalina Sevak.  The current project that I am
working on consists of a series of services to be deployed into Phoenix.  I
must be able to allow webapps to access these other services...a requirement
not yet implemented by Sevak.  Addtionally I may need to allow these
services to update/add/remove webapps that are currently deployed.  The
approach that I have taken so far is to create Avalon-based classes to
implement the required interfaces and have these classes dynamically
delegate to Tomcat-based classes using reflection.  Thus far I have
implemented a bootstrap mechanism that replicates the Tomcat startup script
and a custom Catalina Server implementation the eliminates the standard
socket-based shutdown used by Tomcat.  My goal is to eventually have a
custom Context class that delegates to Tomcat's StandardContext, adding
functionality as needed.  One such instance is in creating the
ServletContext.  By implementing this custom Context, I hope to be able to
set things like the ServiceManager into the ServletContext as an
attribute...what do you think?

> given my recent (unsuccessful) endeavour of getting Jo! to run under
Phoenix, I
> began to wonder what a connection between Phoenix and the Web could/should
look
> like. I think it is imperative for a server application framework and an
> applicaton server to be able to serve the Web.
I think that Web application components would like to be able to access and
utilize the services of other components within Phoenix as if the Web
application was itself a phoenix component.  I imagine that other components
might require the ability to deploy web applications, create custom Service
blocks within the web server, start/stop these service blocks, etc.  For
example, say that I have created a phoenix service that controls an external
hardware resource and want to be able to manipulate that service via a web
application.  I would need to create a block that depends on Sevak and has
the ability to specify a webapp Context that contains references back to
itself, and to specify which Host within Sevak this webapp should be
deployed to.

>
> Here are some options I can think of:
>
> 1) There is a class called PhoenixServlet, but it is labelled as
experimental.
> It does not seem to do very much either. What is its purpose?
Phoenix is an application server kernel...utilizing Phoenix as a component
embedded within a Web Container does not make much sense.

>
> 2) Jo! and Sevak can run servlets, but they have no native way to
communicate
> with other apps (except via AltRMI or similar methods). I don't think it
is
> possible to persuade the developers of Jo! or Catalina to componentize
their
> designs to accommodate Avalon/Phoenix. But everything else is just a hack.
If they won't componentize their design, we must create abstract wrappers to
adapt the two.

>
> 3) How about an ajpv12 or ajpv13 component? Maybe the code can be nicked
from
> Catalina and repackaged as a component. Then every Phoenix app could just
use
> that component and be fully connected to everyone who supports mod_jk or
> mod_jserv (mainly the Apache httpd, but also some other webservers).
You lost me here...what is the advantage?

>
> 4) MX4J already has a HTTPConnector, but it is fairly limited to JMX. But
we
> just need a way to pass control to an arbitrary app and give back a
response,
> maybe it can be done with MX4J?
>
> 5) Development of a HTTP component. It does not need to be a full-blown
> webserver, we just need to speak HTTP. For access control, URL rewriting,
error
> handling and all those other fancy features we could rely on an external
> webserver and assume that he makes sure to forward only "safe and
appropriate"
> HTTP requests to us for backend processing. Connections have to be limited
to
> that webserver, though. Most webservers have a way to forward HTTP
requests to
> another webserver.
If you are looking for a way to provide web access via Sockets, I believe
such components exist within Excalibur that can be used within Phoenix.


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


Re: Phoenix and the Web

Posted by Leo Simons <le...@apache.org>.
On Tue, 2002-10-01 at 11:41, Ulrich Mayring wrote:
> Leo Simons wrote:
> 
> > ...I'm not too familiar with ajp. IIRC I didn't like it because it
> > made too many assumptions and used strings/chars.....but that was
> > when the world still used JServ....it sounds like the sensible
> > way too go....
> > 
> > I'd like to see it :)
> 
> The problem I have with this approach is that there seems to be no sensible Java 
> API (similar to the Servlet API) to manipulate incoming requests and outgoing 
> responses. It's not very OO, apparently, but when we bring something into 
> Phoenix, we want it to be OO.

that is, indeed, exactly the problem. I think at some level, you'll have
to define your own API.

> > Avalon-based http 1.1 implementation is high on the would-like-
> > to-see-but-no-itch-to-develop list for I suspect quite a few
> > people.
> > 
> > There's quite a few http impls in java available to rip off of course
> > (one I know of is coyote)
> 
> Again I have the "missing API" problem here. Suppose we have an HTTP component, 
> then how are we going to use it? We could either implement the whole Servlet API 
> on top of it (yuck) or do something proprietary. Like maybe this:
> 
> if (uri.equals("/what/ever")) doThis();
> else if (uri.equals("/what/else")) doThat();
> else doSomethingElse();
> 
> It's not the way we want to work in Phoenix :)

nope. There is no reusable OO standard here. Basically I think the
proper architecture needs a HTTPRequest, HTTPResponse, HTTPService, and
a way to plug in HTTPRequestHandlers.
And to max out reuse, the HTTPRequestHandler should be some kind of
pipeline/interceptor chain. And once you have all that set up, it seems
silly to not generalize the pipeline to support any Request/Response
protocol....eh....is this worth it, or are we sticking with embedded
servlet engines......?

> > 7) probably the coolest is writing an avalon+event-based http
> > implementation from scratch that beats everything else wrt speed,
> > architecture, and pluggability.
> 
> Develop an Avalon-specific API for HTTP thereby blowing the Servlet API out of 
> the water?

not just the servlet API, also apache httpd, iPlanet, IIS, EJB, .... :)

> > 8) roll-your-own protocol and apache httpd module
> > (one thing I found out recently: modules are easy =)
> > 9) run java within PHP within apache and have that talk to phoenix
> > over AltRMI
> > 10) run java within Python (mod_snake) within apache and have that
> > talk to phoenix over AltRMI
> > 11) rip apart axis and run it inside phoenix, then have it
> > accept calls from IIS.Net
> > 12) run phoenix inside Jboss and map requests from Jetty to phoenix
> > through Jboss's JMX kernel (I think it still works that way?)
> 
> 8-12: Please not :)

I've done all of those :/

"here's a PHP/MySQL CMS, an Oracle database, and a java ORB full of
crappy business objects. Please wire them together in 72h. Oh, and would
it be possible to export everything over SOAP as well so we can call it
.Net-compatible?"

Who cares about software architecture anyway :D

cheers,

Leo



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


Re: Phoenix and the Web

Posted by Ulrich Mayring <ul...@denic.de>.
Leo Simons wrote:

> ...I'm not too familiar with ajp. IIRC I didn't like it because it
> made too many assumptions and used strings/chars.....but that was
> when the world still used JServ....it sounds like the sensible
> way too go....
> 
> I'd like to see it :)

The problem I have with this approach is that there seems to be no sensible Java 
API (similar to the Servlet API) to manipulate incoming requests and outgoing 
responses. It's not very OO, apparently, but when we bring something into 
Phoenix, we want it to be OO.

> Avalon-based http 1.1 implementation is high on the would-like-
> to-see-but-no-itch-to-develop list for I suspect quite a few
> people.
> 
> There's quite a few http impls in java available to rip off of course
> (one I know of is coyote)

Again I have the "missing API" problem here. Suppose we have an HTTP component, 
then how are we going to use it? We could either implement the whole Servlet API 
on top of it (yuck) or do something proprietary. Like maybe this:

if (uri.equals("/what/ever")) doThis();
else if (uri.equals("/what/else")) doThat();
else doSomethingElse();

It's not the way we want to work in Phoenix :)

> 7) probably the coolest is writing an avalon+event-based http
> implementation from scratch that beats everything else wrt speed,
> architecture, and pluggability.

Develop an Avalon-specific API for HTTP thereby blowing the Servlet API out of 
the water?

> 8) roll-your-own protocol and apache httpd module
> (one thing I found out recently: modules are easy =)
> 9) run java within PHP within apache and have that talk to phoenix
> over AltRMI
> 10) run java within Python (mod_snake) within apache and have that
> talk to phoenix over AltRMI
> 11) rip apart axis and run it inside phoenix, then have it
> accept calls from IIS.Net
> 12) run phoenix inside Jboss and map requests from Jetty to phoenix
> through Jboss's JMX kernel (I think it still works that way?)

8-12: Please not :)

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung


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


RE: Phoenix and the Web

Posted by Leo Simons <le...@apache.org>.
> Hello folks,
> 
> given my recent (unsuccessful) endeavour of getting Jo! to 
> run under Phoenix, I 
> began to wonder what a connection between Phoenix and the Web 
> could/should look 
> like. I think it is imperative for a server application 
> framework and an 
> applicaton server to be able to serve the Web.

=)

> Here are some options I can think of:
> 
> 1) There is a class called PhoenixServlet, but it is labelled 
> as experimental. 
> It does not seem to do very much either. What is its purpose?

Embed phoenix inside a servlet engine (or j2ee server). Ugh.
Think it is unmaintained and there for compatibility. I think
that (once released) it makes more sense to use Fortress and/or
Merlin for this (it makes no sense to me to deploy a .bar into
a .sar into a .war into an .ear).

> 2) Jo! and Sevak can run servlets, but they have no native 
> way to communicate 
> with other apps (except via AltRMI or similar methods). I 
> don't think it is 
> possible to persuade the developers of Jo! or Catalina to 
> componentize their 
> designs to accommodate Avalon/Phoenix. But everything else is 
> just a hack.

Yup.

> 3) How about an ajpv12 or ajpv13 component? Maybe the code 
> can be nicked from 
> Catalina and repackaged as a component. Then every Phoenix 
> app could just use 
> that component and be fully connected to everyone who 
> supports mod_jk or 
> mod_jserv (mainly the Apache httpd, but also some other webservers).

...I'm not too familiar with ajp. IIRC I didn't like it because it
made too many assumptions and used strings/chars.....but that was
when the world still used JServ....it sounds like the sensible
way too go....

I'd like to see it :)

> 4) MX4J already has a HTTPConnector, but it is fairly limited 
> to JMX. But we 
> just need a way to pass control to an arbitrary app and give 
> back a response, 
> maybe it can be done with MX4J?

I'd also consider that a hack :)

> 5) Development of a HTTP component. It does not need to be a 
> full-blown 
> webserver, we just need to speak HTTP. For access control, 
> URL rewriting, error 
> handling and all those other fancy features we could rely on 
> an external 
> webserver and assume that he makes sure to forward only "safe 
> and appropriate" 
> HTTP requests to us for backend processing. Connections have 
> to be limited to 
> that webserver, though. Most webservers have a way to forward 
> HTTP requests to 
> another webserver.

If you develop an http 1.1 implementation the avalon way I'm sure
the fancy features will be easily plugged in ;)

Avalon-based http 1.1 implementation is high on the would-like-
to-see-but-no-itch-to-develop list for I suspect quite a few
people.

There's quite a few http impls in java available to rip off of course
(one I know of is coyote)

> Any other ideas/comments? I like option 3) best.

....Probably the quickest thing is ripping apart an existing
servlet engine....ie the 'hack'....but I like 3) too

7) probably the coolest is writing an avalon+event-based http
implementation from scratch that beats everything else wrt speed,
architecture, and pluggability.

8) roll-your-own protocol and apache httpd module
(one thing I found out recently: modules are easy =)

9) run java within PHP within apache and have that talk to phoenix
over AltRMI

10) run java within Python (mod_snake) within apache and have that
talk to phoenix over AltRMI

11) rip apart axis and run it inside phoenix, then have it
accept calls from IIS.Net

12) run phoenix inside Jboss and map requests from Jetty to phoenix
through Jboss's JMX kernel (I think it still works that way?)

(...)

I still think I like #3 best as well.

Cheers,

Leo



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