JBOSS 简介-david(精品).ppt
JBOSS 簡介本節綱要qJ2EE執行環境_JBoss qExample _ HelloWorld ServletqJ2EE開發環境_Ant u JBoss 簡介u The JBoss JMX Microkernelu What is JMX?u Installation of JBoss3.2.5 with bundled Tomcat 4J2EE執行環境 _ JBOSS 簡介qJBoss was started in March 1999qInitially was just an Enterprise Java Bean Container.Now JBoss implements the entire J2EE stackqOpen source J2EE application server based on JMX architectureADVANCED JBOSS CONFIGURATIONqHttpSession state replication for TomcatqAutomatic DiscoveryqLoad Balancing for all JNDI,RMI and EJB typesqFarming Distributed deployment of EJBsTHE JBOSS JMX MICROKERNELqFull J2EE stack implementation provided by JBossJTS/JTASECURITYDATA SOURCEREMOTEMANAGEMENTEJB CONTAINERDATABASESJAVA SERVERPAGESJMSJMX ImplementationJMX ImplementationWHAT IS JMX?qJMX Java Management ExtensionqJMX提供統一的管理介面,讓管理架構變的更容易qJMX的核心概念_ Mbean(Manager Bean)q在JMX中管理分成三個層級 Instrumentation Layer位於最底層,是可以被管理的服務或應用程式,亦即MBean Agent Layer核心部分是一個MBean Server,所有的MBean都需要在MBean Server註冊 Distributed Service Layer此層通常為一個管理程式,或一個瀏覽器Distributed service layerAgent layerInstrumentation layerJVM interfaceXXXMBeanXXXMBeanServerMBeanServerAgentAgentserviceserviceMBeanMBeanexposeexposeWhat is JMX?What is JMX?qJMX中管理分成三個層級INSTALLATION OF JBOSS3.2.5qJBoss downloadhttp:/ download _ http:/ IDE BASED ON ECLIPSE q建立一個新專案_JBoss-IDEJEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse qServer 建置 _ Debug Configuration qCreate source and output configurationJEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse qCLASSPATH by defining the libraries(JAR files)JEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse qHello.java import java.io.*;import java.io.*;import javax.servlet.*;import javax.servlet.*;import javax.servlet.http.*;import javax.servlet.http.*;public class Hello extends HttpServletpublic class Hello extends HttpServlet public void doGet(HttpServletRequest request,HttpServletResponse response)public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException throws ServletException,IOException response.setContentType(text/html;charset=big5);response.setContentType(text/html;charset=big5);PrintWriter out=response.getWriter();PrintWriter out=response.getWriter();out.println();out.println();out.println();out.println();out.println();out.println();out.println(Hello out.println(Hello 你好嗎.!);.!);out.println();out.println();out.println();out.println();out.close();out.close();JEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse qweb.xml!DOCTYPE web-app PUBLIC-/Sun Microsystems,Inc./DTD We Application 2.3/ENhttp:/ IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse qCreate a Packaging Configuration JEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse removeqRun Packaging產生-hello.war and packaging-build.xml fileqSelect Deployment,and then Deploy To JEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse JEMS IDE based on Eclipse qHttp:/localhost:8080/Hello/HelloANT _ 安裝與設定qAnt downloadhttp:/ant/apache.ort/index.htmlq設定環境變數變數名稱:ANT_HOME變數值:E:SDapacheapache-ant-1.6.2ANT _ 撰寫 BUILD.XMLANT _ 撰寫 BUILD.XMLjavadoc packagenames=jp.*windowtitle=Sample$version ANT _ 執行結果q 執行Ant E:sdapacheapache-antsampleantq 執行範例應用程式E:sdapacheapache-antsamplejava cp dist/sample.jar test.HelloQ&A