[Design of POJO Server] - Porting Hibernate MBean / deployer
by alesj
org.jboss.hibernate.jmx.Hibernate 'deployer' uses this piece of code:
| private URL determineHarUrl() throws Exception
| {
| log.trace( "Attempting to determine HarUrl..." );
| DeploymentInfo deploymentInfo = getDeploymentInfo();
| if ( deploymentInfo == null )
| {
| log.warn( "Unable to locate deployment info [" + getServiceName() + "]" );
| return null;
| }
|
the interesting/critical part is this method:
| public DeploymentInfo getDeploymentInfo()
| throws JMException
| {
| Object[] args = {serviceName};
| String[] sig = {serviceName.getClass().getName()};
| DeploymentInfo sdi = (DeploymentInfo) server.invoke(SARDeployerMBean.OBJECT_NAME,
| "getService", args, sig);
| return sdi;
| }
|
Which returns null, since old SARDeployer isn't used anymore, hence empty ObjectName --> DeploymentInfo map.
Is there an equivalent thing?
Or should I go and write new deployer from scratch?
But since this class isn't really a true deployer, it's a simple MBean that knew how to do a URL lookup for entities, ... how to resemble between regualar mbeans and Hibernate mbean / 'deployer'?
We can force the Hibernate users to declare this mbean in a renamed file, instead of jboss-service.xml it could be simple hibernate.xml.
Any ideas on this port?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111321#4111321
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111321
18 years, 4 months
[Design of Management Features on JBoss] - Patch to upgrade jfreechart to v1.0.2
by csaldanh
Currently the JMX-console uses jfreechart v0.9.20. When upgrading to v1.0.2 it gave compilation errors in console. The following patch takes care of the upgrade:
diff -Naur trunk/build/build-thirdparty.xml trunk_jfreechart_upgrade/build/build-thirdparty.xml
--- trunk/build/build-thirdparty.xml 2007-12-06 16:05:21.000000000 -0500
+++ trunk_jfreechart_upgrade/build/build-thirdparty.xml 2007-12-06 16:37:53.000000000 -0500
@@ -113,7 +113,7 @@
-
+
diff -Naur trunk/console/src/main/org/jboss/console/manager/interfaces/impl/GraphMBeanAttributeAction.java trunk_jfreechart_upgrade/console/src/main/org/jboss/console/manager/interfaces/impl/GraphMBeanAttributeAction.java
--- trunk/console/src/main/org/jboss/console/manager/interfaces/impl/GraphMBeanAttributeAction.java 2007-12-06 16:05:38.000000000 -0500
+++ trunk_jfreechart_upgrade/console/src/main/org/jboss/console/manager/interfaces/impl/GraphMBeanAttributeAction.java 2007-12-06 16:39:25.000000000 -0500
@@ -28,8 +28,8 @@
import org.jfree.chart.ChartFrame;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
-import org.jfree.data.AbstractXYDataset;
-import org.jfree.data.DatasetChangeEvent;
+import org.jfree.data.xy.AbstractXYDataset;
+import org.jfree.data.general.DatasetChangeEvent;
import javax.management.ObjectName;
import java.util.ArrayList;
@@ -84,7 +84,7 @@
*
* @return the x-value for the specified series and item.
*/
- public Number getXValue(int series, int item)
+ public Number getX(int series, int item)
{
return new Integer(item);
}
@@ -97,12 +97,59 @@
*
* @return the y-value for the specified series and item.
*/
- public Number getYValue(int series, int item)
+ public Number getY(int series, int item)
{
return (Number) data.get(item);
}
/**
+ * Returns the x-value for the specified series and item. Series are numbered 0, 1, ...
+ *
+ * @param series the index (zero-based) of the series.
+ * @param item the index (zero-based) of the required item.
+ *
+ * @return the x-value for the specified series and item.
+ */
+ public double getXValue(int series, int item)
+ {
+ return item;
+ }
+
+ /**
+ * Returns the y-value for the specified series and item. Series are numbered 0, 1, ...
+ *
+ * @param series the index (zero-based) of the series.
+ * @param item the index (zero-based) of the required item.
+ *
+ * @return the y-value for the specified series and item.
+ */
+ public double getYValue(int series, int item)
+ {
+ double result = Double.NaN;
+ Number x = (Number)data.get(item);
+ if (x != null) {
+ result = x.doubleValue();
+ }
+ return result;
+ }
+
+ /**
+ * Returns the key for a series.
+ *
+ * If series is not within the specified range, the
+ * implementing method should throw an {@link IndexOutOfBoundsException}
+ * (preferred) or an {@link IllegalArgumentException}.
+ *
+ * @param series the series index (in the range 0 to
+ * getSeriesCount() - 1).
+ *
+ * @return The series key.
+ */
+ public Comparable getSeriesKey(int series){
+ return null; //Switching to new jfreechart API so really don't use this.
+ }
+
+ /**
* Returns the number of series in the dataset.
*
* @return the number of series in the dataset.
diff -Naur trunk/console/src/main/org/jboss/console/plugins/monitor/ManageSnapshotServlet.java trunk_jfreechart_upgrade/console/src/main/org/jboss/console/plugins/monitor/ManageSnapshotServlet.java
--- trunk/console/src/main/org/jboss/console/plugins/monitor/ManageSnapshotServlet.java 2007-12-06 16:05:37.000000000 -0500
+++ trunk_jfreechart_upgrade/console/src/main/org/jboss/console/plugins/monitor/ManageSnapshotServlet.java 2007-12-06 16:41:22.000000000 -0500
@@ -38,8 +38,8 @@
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
-import org.jfree.data.DefaultTableXYDataset;
-import org.jfree.data.XYSeries;
+import org.jfree.data.xy.DefaultTableXYDataset;
+import org.jfree.data.xy.XYSeries;
/**
* @author Bill Burke
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111313#4111313
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111313
18 years, 4 months