tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dipesh Khakhkhar" <dipeshsoftw...@gmail.com>
Subject Fwd: Setting Connector's attribute and consuming SOAP request in embedded tomcat
Date Mon, 02 Apr 2007 16:35:03 GMT
Hi,

No messages for this question. I am not sure whether my question did reach
to list or not. I would appreciate any pointer in this direction.

Thanks!

---------- Forwarded message ----------
From: Dipesh Khakhkhar <dipeshsoftware@gmail.com>
Date: Mar 30, 2007 6:44 PM
Subject: Setting Connector's attribute and consuming SOAP request in
embedded tomcat
To: users@tomcat.apache.org


Hi,

I am using embedded tomcat 5.5.16. I am trying to embed tomcat server in my
java application. I tried to find how to set some attributes like
maxThreads, acceptCount and so on but was not able to find a good way to do
this in embedded tomcat application.

Secondly I am trying to feed SOAP request to this server, so where do i need
to set my wsdd file.

I have tried the following.

/**
*import* java.net.UnknownHostException;

***

import
*org.apache.catalina.connector.Connector;*

import
*org.apache.catalina.Context;

*

import
*org.apache.catalina.Engine;*

import
*org.apache.catalina.Host;*

import
*org.apache.catalina.LifecycleException;

*

import
*org.apache.catalina.startup.Embedded;*

public
**class* EmbeddedServer

{

*private* String path = *null *;

*private* Embedded embedded = *null *;

*private* Host host = *null* ;

*private* *int* port ;

*private* Engine engine = *null *;

*private* Connector connector = *null *;

*private* Context context = *null *;

/**

* Basic Accessor setting the value of the context path

*

* *@param* path - the path

*/

*public* *void* setPath(String path, *int* port) {

*this*.path = path;

*this*.port = port;

}

/**

* Basic Accessor returning the value of the context path

*

* *@return* - the context path

*/

*public* String getPath() {

*return* path;

}

*public* *int* getPort() {

*return* port;

}

*public* *void* start() *throws *LifecycleException, UnknownHostException

{

 // Set the home directory

System.*setProperty*(
"catalina.home", getPath());

embedded = *new* Embedded();

 // Create an engine

engine = embedded.createEngine();

engine.setDefaultHost( "localhost" );

 // Create a default virtual host

host = embedded.createHost(InetAddress.*getLocalHost*().getHostName(),
getPath()

+
"/webapps");

engine.addChild(host);

// Create the ROOT context

context = embedded.createContext("" , getPath() + "/webapps/ROOT");

host.addChild(context);

// Install the assembled container hierarchy

embedded.addEngine(engine);

//Assemble and install a default HTTP connector

connector = embedded.createConnector((java.net.InetAddress) *null*,
getPort(), *false*);

// configure connector attributes

embedded.addConnector(connector);

  // Start the embedded server

embedded.start();

}

/**

* This method Stops the Tomcat server.

*/

*public* *void* stopTomcat() *throws* Exception {

// Stop the embedded server

embedded.stop();

}

 }

*/

I am not sure how can i set up attributes for my Connector and how to use
WSDD file. Thanks in advance for any help or hints to fix this issue.

Thanks!

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message