[jboss-svn-commits] JBL Code SVN: r7849 - labs/reportingservices/trunk/dev/modules/server/impl/src/main/java/org/jboss/reporting/server/deployer

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Nov 27 04:05:48 EST 2006


Author: noel.rocher at jboss.com
Date: 2006-11-27 04:05:44 -0500 (Mon, 27 Nov 2006)
New Revision: 7849

Removed:
   labs/reportingservices/trunk/dev/modules/server/impl/src/main/java/org/jboss/reporting/server/deployer/DeployerRPTDESIGN.java
   labs/reportingservices/trunk/dev/modules/server/impl/src/main/java/org/jboss/reporting/server/deployer/DeployerRPTDESIGNMBean.java
Log:


Deleted: labs/reportingservices/trunk/dev/modules/server/impl/src/main/java/org/jboss/reporting/server/deployer/DeployerRPTDESIGN.java
===================================================================
--- labs/reportingservices/trunk/dev/modules/server/impl/src/main/java/org/jboss/reporting/server/deployer/DeployerRPTDESIGN.java	2006-11-27 09:04:39 UTC (rev 7848)
+++ labs/reportingservices/trunk/dev/modules/server/impl/src/main/java/org/jboss/reporting/server/deployer/DeployerRPTDESIGN.java	2006-11-27 09:05:44 UTC (rev 7849)
@@ -1,265 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.reporting.server.deployer;
-
-import java.io.File;
-
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.Notification;
-import javax.management.ObjectName;
-
-//import org.eclipse.birt.report.engine.api.IReportDocument;
-import org.jboss.deployment.DeploymentException;
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.mx.util.MBeanProxyExt;
-import org.jboss.mx.util.ObjectNameFactory;
-import org.jboss.reporting.api.Report;
-import org.jboss.reporting.server.ReportInfo;
-import org.jboss.reporting.server.engine.ReportEngineMBean;
-import org.jboss.reporting.server.repository.RepositoryEntry;
-
-/**
- * This deployer compiles a BIRT Report xml design and puts the result into the
- * repository
- * 
- * @jmx:mbean name="reporting:service=ReportsDeployer,type=RPTDESIGN" extends="org.jboss.deployment.SubDeployerMBean"
- * 
- * @version <tt>$Revision: 1.0 $</tt>
- * @author <a href="mailto:noel.rocher at jboss.org">Noel Rocher</a>
- */
-public class DeployerRPTDESIGN extends AbstractReportDeployer implements DeployerRPTDESIGNMBean
-{
-
-    private static final ObjectName OBJECT_NAME = ObjectNameFactory.create("reporting:service=ReportsDeployer,type=RPTDESIGN");
-
-    private ReportEngineMBean engine;
-
-    private ObjectName reportEngine;
-
-    protected ObjectName getObjectName(MBeanServer server, ObjectName name) throws MalformedObjectNameException
-    {
-        return name == null ? OBJECT_NAME : name;
-    }
-
-    /**
-     * Get the value of ReportEngine.
-     * 
-     * @jmx:managed-attribute
-     * @return value of ReportEngine.
-     */
-    public ObjectName getReportEngine()
-    {
-        return reportEngine;
-    }
-
-    /**
-     * Set the value of ReportEngine.
-     * 
-     * @jmx:managed-attribute
-     * @param v
-     *            Value to assign to ReportEngine.
-     */
-    public void setReportEngine(ObjectName objectName)
-    {
-        this.reportEngine = objectName;
-    }
-
-    /**
-     * Gets a reference to the JasperReports Engine MBean
-     */
-    protected void startService() throws Exception
-    {
-        engine = (ReportEngineMBean) MBeanProxyExt.create(ReportEngineMBean.class, reportEngine, server);
-
-        // register with MainDeployer
-        super.startService();
-    }
-
-    protected void stopService() throws Exception
-    {
-        // deregister with MainDeployer
-        super.stopService();
-        engine = null;
-    }
-
-    /**
-     * accepts xxx.rptdesign files
-     */
-    public boolean accepts(DeploymentInfo di)
-    {
-        // To be accepted the deployment's root name must end in jar
-        String urlStr = di.url.getFile();
-        if (!urlStr.toUpperCase().endsWith("RPTDESIGN"))
-        {
-            return false;
-        }
-        else
-        {
-            log.debug("accepts> url=" + di.url + ", accepted=" + true);
-            return true;
-        }
-    }
-
-    /**
-     * initialize the URL to be watched
-     */
-    public void init(DeploymentInfo di) throws DeploymentException
-    {
-        log.info("init, " + di.shortName);
-
-        try
-        {
-            di.watch = di.url;
-            log.info("Watch file : " + di.url);
-        }
-        catch (Exception e)
-        {
-            if (e instanceof DeploymentException) throw (DeploymentException) e;
-            throw new DeploymentException("failed to initialize", e);
-        }
-
-        // invoke super-class initialization
-        di.isXML = true;
-        super.init(di);
-    }
-
-    /**
-     * <li>compile the report</li>
-     * <li>bind or rebind it into the JNDI tree</li>
-     */
-    public synchronized void start(DeploymentInfo di) throws DeploymentException
-    {
-        super.start(di);
-//        try
-//        {
-//            ObjectName engineName = new ObjectName("reporting:service=ReportEngine,type=" + di.shortName.substring(di.shortName.lastIndexOf('.') + 1).toUpperCase());
-//            IReportDocument report = (IReportDocument) engine.compile(new java.io.FileInputStream(di.url.getFile()), engineName);
-//            String jndi_name = toJndiName(di.shortName);
-//            String jndi_path = DEFAULT_DOMAIN;
-//            repository.put(jndi_path + "/" + jndi_name, new RepositoryEntry(report, engineName));
-//
-//            // build the ReportInfo for notification
-//            ReportInfo ri = new ReportInfo();
-//            ri.setFile(new File(di.url.getFile()));
-//
-//            Report r = new Report();
-//            r.setReport_name(jndi_name);
-//            r.setReport_path(jndi_path);
-//            /*
-//             * JRParameter[] jr_params = report.getParameters(); if (jr_params !=
-//             * null && jr_params.length > 0) { Map parameters = new
-//             * java.util.HashMap(jr_params.length); for (int i=0; i <
-//             * jr_params.length ; i++ ) { if (jr_params[i].isForPrompting()) {
-//             * parameters.put(jr_params[i].getName(),
-//             * jr_params[i].getDescription()); } } r.setParameters(parameters); }
-//             */
-//
-//            ri.setReport(r);
-//
-//            // Issue the DeployerJRXML.ADD_REPORT_NOTIFICATION
-//            Notification msg = new Notification(AbstractReportDeployer.ADD_REPORT_NOTIFICATION, this, getNextNotificationSequenceNumber());
-//            msg.setUserData(ri);
-//            sendNotification(msg);
-//        }
-//        catch (Exception e)
-//        {
-//            log.error(e.getMessage());
-//        }
-
-    }
-
-    /**
-     * <li>unbind the report from the JNDI tree</li>
-     */
-    public void stop(DeploymentInfo di) throws DeploymentException
-    {
-        super.stop(di);
-        try
-        {
-            String jndi_name = toJndiName(di.shortName);
-            String jndi_path = DEFAULT_DOMAIN;
-            repository.remove(jndi_path + "/" + jndi_name);
-            // build the ReportInfo for notification (only jndi path & name are
-            // necessary)
-            ReportInfo ri = new ReportInfo();
-            Report r = new Report();
-            r.setReport_path(jndi_path);
-            r.setReport_name(jndi_name);
-            ri.setReport(r);
-
-            // Issue the DeployerJRXML.REMOVE_REPORT_NOTIFICATION
-            Notification msg = new Notification(AbstractReportDeployer.REMOVE_REPORT_NOTIFICATION, this, getNextNotificationSequenceNumber());
-            msg.setUserData(ri);
-            sendNotification(msg);
-        }
-        catch (Exception e)
-        {
-            log.error(e.getMessage());
-        }
-    }
-
-    // -----------------------------------------
-
-    // /**
-    // * Bind the report into jndi
-    // */
-    // protected void bindReport(String jndi_path, String jndi_name,JasperReport
-    // report) throws Exception
-    // {
-    // InitialContext ctx = new InitialContext();
-    // try
-    // {
-    // log.debug("Binding object '" + jndi_name + "' into JNDI at 'java:/" +
-    // jndi_path + "/'");
-    // Name name = ctx.getNameParser("").parse(jndi_path+"/"+jndi_name);
-    // NonSerializableFactory.rebind(name, report, true);
-    // log.info("Bound Report '" + jndi_name + " to JNDI name '" + name + "'");
-    // }
-    // catch (NamingException ne)
-    // {
-    // ne.printStackTrace();
-    // throw new DeploymentException("Could not bind Report into jndi: " +
-    // jndi_path + "/" + jndi_name);
-    // }
-    // finally
-    // {
-    // ctx.close();
-    // }
-    // }
-    //   
-    // /**
-    // * Unbind the report from jndi
-    // */
-    // protected void unbindReport(String jndi_path, String jndi_name) throws
-    // Exception
-    // {
-    // InitialContext ctx = new InitialContext();
-    // try
-    // {
-    // Name name = ctx.getNameParser("").parse(jndi_path+"/"+jndi_name);
-    // NonSerializableFactory.unbind(name);
-    // ctx.unbind(name);
-    // log.info("Unbound Report '" + jndi_name + " from JNDI name '" + name +
-    // "'");
-    // }
-    // catch (NamingException ne)
-    // {
-    // ne.printStackTrace();
-    //         log.error("Could not unbind Report from jndi: " + jndi_path + "/" + jndi_name, ne);
-    //      }
-    //      finally
-    //      {
-    //         ctx.close();
-    //      }
-    //   }
-
-    protected static String toJndiName(String in_string)
-    {
-        return in_string.replaceAll(".rptdesign", "").replaceAll(".RPTDESIGN", "").replaceAll(" ", "_");
-    }
-}

Deleted: labs/reportingservices/trunk/dev/modules/server/impl/src/main/java/org/jboss/reporting/server/deployer/DeployerRPTDESIGNMBean.java
===================================================================
--- labs/reportingservices/trunk/dev/modules/server/impl/src/main/java/org/jboss/reporting/server/deployer/DeployerRPTDESIGNMBean.java	2006-11-27 09:04:39 UTC (rev 7848)
+++ labs/reportingservices/trunk/dev/modules/server/impl/src/main/java/org/jboss/reporting/server/deployer/DeployerRPTDESIGNMBean.java	2006-11-27 09:05:44 UTC (rev 7849)
@@ -1,21 +0,0 @@
-package org.jboss.reporting.server.deployer;
-
-/**
- * MBean interface.
- */
-public interface DeployerRPTDESIGNMBean extends org.jboss.deployment.SubDeployerMBean {
-
-   //default object name
-   public static final javax.management.ObjectName OBJECT_NAME = org.jboss.mx.util.ObjectNameFactory.create("reporting:service=ReportsDeployer,type=RPTDESIGN");
-
-   /**
-    * Get the value of ReportEngine.
-    * @return value of ReportEngine.    */
-  javax.management.ObjectName getReportEngine() ;
-
-   /**
-    * Set the value of ReportEngine.
-    * @param v Value to assign to ReportEngine.    */
-  void setReportEngine(javax.management.ObjectName objectName) ;
-
-}




More information about the jboss-svn-commits mailing list