JBoss-OSGI SVN: r90833 - in projects/jboss-osgi: trunk and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-06 07:58:51 -0400 (Mon, 06 Jul 2009)
New Revision: 90833
Added:
projects/jboss-osgi/projects/spi/trunk/
Removed:
projects/jboss-osgi/trunk/spi/
Log:
Extract SPI to projects
Copied: projects/jboss-osgi/projects/spi/trunk (from rev 90832, projects/jboss-osgi/trunk/spi)
16 years, 6 months
JBoss-OSGI SVN: r90831 - projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-06 07:55:05 -0400 (Mon, 06 Jul 2009)
New Revision: 90831
Modified:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/DeployerService.java
Log:
[JBOSGI-66] Support bundle deployment through web console
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java 2009-07-06 09:49:21 UTC (rev 90830)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/BundleInfo.java 2009-07-06 11:55:05 UTC (rev 90831)
@@ -35,24 +35,11 @@
public interface BundleInfo
{
/**
- * The state of the bundle
- */
- enum State
- {
- NEW, INSTALLED, ACTIVE, UNINSTALLED
- }
-
- /**
* Get the bundle location
*/
URL getLocation();
/**
- * Get the bundle state
- */
- State getState();
-
- /**
* Get the bundle symbolic name
*/
String getSymbolicName();
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/DeployerService.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/DeployerService.java 2009-07-06 09:49:21 UTC (rev 90830)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/DeployerService.java 2009-07-06 11:55:05 UTC (rev 90831)
@@ -26,6 +26,7 @@
import javax.management.ObjectName;
import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
//$Id$
@@ -44,6 +45,17 @@
ObjectName MBEAN_DEPLOYER_SERVICE = ObjectNameFactory.create("jboss.osgi:service=DeployerService");
/**
+ * Get the bundle info for the given bundle URL
+ */
+ BundleInfo getBundleInfo(URL url) throws BundleException;
+
+ /**
+ * Get the installed bundle for the given bundle info
+ * @return null, if there is no bundle that matches the given bundle info
+ */
+ Bundle getBundle(BundleInfo info) throws BundleException;
+
+ /**
* Deploy an array of bundles
*/
void deploy(BundleInfo[] bundles) throws BundleException;
16 years, 6 months
JBoss-OSGI SVN: r90829 - projects/jboss-osgi/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-06 05:15:33 -0400 (Mon, 06 Jul 2009)
New Revision: 90829
Modified:
projects/jboss-osgi/trunk/pom.xml
Log:
[JBOSGI-104] - Upgrade to Felix Web Console 1.2.10
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-07-06 09:12:53 UTC (rev 90828)
+++ projects/jboss-osgi/trunk/pom.xml 2009-07-06 09:15:33 UTC (rev 90829)
@@ -57,7 +57,7 @@
<version.jboss.osgi.runtime.felix>1.0.0-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.runtime.knopflerfish>1.0.0.Beta2</version.jboss.osgi.runtime.knopflerfish>
<version.jboss.osgi.spi>1.0.0-SNAPSHOT</version.jboss.osgi.spi>
- <version.jboss.osgi.webconsole>1.0.0.Beta2</version.jboss.osgi.webconsole>
+ <version.jboss.osgi.webconsole>1.0.0-SNAPSHOT</version.jboss.osgi.webconsole>
<version.jboss.osgi.xml.binding>2.0.1-SNAPSHOT</version.jboss.osgi.xml.binding>
<version.junit>4.6</version.junit>
<version.osgi>r4v41</version.osgi>
16 years, 6 months
JBoss-OSGI SVN: r90828 - in projects/jboss-osgi/projects/bundles/webconsole/trunk: src/main/java/org/apache/felix/webconsole and 4 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-06 05:12:53 -0400 (Mon, 06 Jul 2009)
New Revision: 90828
Added:
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/internal/servlet/RenderBridge.java
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/ConfigManagerPlugin.java
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/LogServicePlugin.java
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/resources/res/ui/logs.js
Removed:
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/ConfigManagerPlugin.java
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/JBossRenderBridge.java
Modified:
projects/jboss-osgi/projects/bundles/webconsole/trunk/pom.xml
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/WebConsole.java
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/PluginHelper.java
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/resources/res/ui/admin.css
projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/resources/res/ui/bundles.js
Log:
[JBOSGI-104] - Upgrade to Felix Web Console 1.2.10
Modified: projects/jboss-osgi/projects/bundles/webconsole/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/pom.xml 2009-07-06 08:25:35 UTC (rev 90827)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/pom.xml 2009-07-06 09:12:53 UTC (rev 90828)
@@ -23,7 +23,7 @@
<version.felix.bundlerepository>1.0.3</version.felix.bundlerepository>
<version.felix.osgi.core>1.2.0</version.felix.osgi.core>
<version.felix.scr>1.0.0</version.felix.scr>
- <version.felix.webconsole>1.2.8</version.felix.webconsole>
+ <version.felix.webconsole>1.2.10</version.felix.webconsole>
<version.javax.servlet>2.4</version.javax.servlet>
<version.json>20070829</version.json>
</properties>
Modified: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java 2009-07-06 08:25:35 UTC (rev 90827)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java 2009-07-06 09:12:53 UTC (rev 90828)
@@ -54,6 +54,7 @@
protected String getHeader()
{
+ // This should be in sync with
String HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
+ "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"xhtml1-transitional.dtd\">"
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\">"
@@ -84,7 +85,6 @@
return HEADER;
}
-
/**
String header = MessageFormat.format( HEADER, new Object[]
{ adminTitle, productName, getTitle(), productWeb, vendorName,
Modified: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java 2009-07-06 08:25:35 UTC (rev 90827)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java 2009-07-06 09:12:53 UTC (rev 90828)
@@ -112,6 +112,30 @@
*/
private static final String DEFAULT_MANAGER_ROOT = "/system/console";
+ protected String[] getPluginClasses()
+ {
+ String[] PLUGIN_CLASSES =
+ { "org.apache.felix.webconsole.internal.compendium.ComponentConfigurationPrinter",
+ "org.apache.felix.webconsole.internal.compendium.ComponentsServlet",
+ "org.apache.felix.webconsole.internal.compendium.ConfigManager",
+ "org.apache.felix.webconsole.internal.compendium.LogServlet",
+ "org.apache.felix.webconsole.internal.core.BundlesServlet",
+ "org.apache.felix.webconsole.internal.core.InstallAction",
+ "org.apache.felix.webconsole.internal.core.SetStartLevelAction",
+ "org.apache.felix.webconsole.internal.deppack.DepPackServlet",
+ "org.apache.felix.webconsole.internal.misc.EventAdminServlet",
+ "org.apache.felix.webconsole.internal.misc.LicenseServlet",
+ "org.apache.felix.webconsole.internal.misc.ConfigurationRender",
+ "org.apache.felix.webconsole.internal.misc.ShellServlet",
+ "org.apache.felix.webconsole.internal.obr.BundleRepositoryRender",
+ "org.apache.felix.webconsole.internal.obr.InstallFromRepoAction",
+ "org.apache.felix.webconsole.internal.obr.RefreshRepoAction",
+ "org.apache.felix.webconsole.internal.system.GCAction",
+ "org.apache.felix.webconsole.internal.system.VMStatPlugin" };
+
+ return PLUGIN_CLASSES;
+ };
+
private BundleContext bundleContext;
private Logger log;
@@ -163,7 +187,7 @@
}
catch ( Throwable t )
{
- log.log(LogService.LOG_WARNING, "Cannot register config listener", t);
+ // might be caused by CM not available
}
// get at the HttpService first, this should initialize
@@ -172,7 +196,7 @@
httpServiceTracker.open();
}
-
+
public void dispose()
{
// now drop the HttpService and continue with further destroyals
@@ -198,29 +222,6 @@
this.bundleContext = null;
}
- protected String[] getPluginClasses()
- {
- return new String[] {
- "org.apache.felix.webconsole.internal.compendium.ComponentConfigurationPrinter",
- "org.apache.felix.webconsole.internal.compendium.ComponentsServlet",
- "org.apache.felix.webconsole.internal.compendium.ConfigManager",
- "org.apache.felix.webconsole.internal.core.BundlesServlet",
- "org.apache.felix.webconsole.internal.core.InstallAction",
- "org.apache.felix.webconsole.internal.core.SetStartLevelAction",
- "org.apache.felix.webconsole.internal.deppack.DepPackServlet",
- "org.apache.felix.webconsole.internal.misc.EventAdminServlet",
- "org.apache.felix.webconsole.internal.misc.LicenseServlet",
- "org.apache.felix.webconsole.internal.misc.ConfigurationRender",
- "org.apache.felix.webconsole.internal.misc.ShellServlet",
- "org.apache.felix.webconsole.internal.obr.BundleRepositoryRender",
- "org.apache.felix.webconsole.internal.obr.InstallFromRepoAction",
- "org.apache.felix.webconsole.internal.obr.RefreshRepoAction",
- "org.apache.felix.webconsole.internal.system.GCAction",
- "org.apache.felix.webconsole.internal.system.ShutdownAction",
- "org.apache.felix.webconsole.internal.system.ShutdownRender",
- "org.apache.felix.webconsole.internal.system.VMStatRender", };
- }
-
/**
* The default value for the {@link #PROP_MANAGER_ROOT} configuration
* property (value is "/system/console").
@@ -230,21 +231,22 @@
return DEFAULT_MANAGER_ROOT;
}
+
//---------- Servlet API
-
+
public void init()
{
// base class initialization not needed, since the GenericServlet.init
// is an empty method
// get the installed plugin classes
- String[] pluginClasses = getPluginClasses();
+ String[] PLUGIN_CLASSES = getPluginClasses();
// setup the included plugins
ClassLoader classLoader = getClass().getClassLoader();
- for ( int i = 0; i < pluginClasses.length; i++ )
+ for ( int i = 0; i < PLUGIN_CLASSES.length; i++ )
{
- String pluginClassName = pluginClasses[i];
+ String pluginClassName = PLUGIN_CLASSES[i];
try
{
Class pluginClass = classLoader.loadClass( pluginClassName );
@@ -284,7 +286,7 @@
pluginsTracker = new PluginServiceTracker( this );
pluginsTracker.open();
}
-
+
public void service( ServletRequest req, ServletResponse res ) throws ServletException, IOException
{
@@ -333,12 +335,12 @@
}
}
-
+
public void destroy()
{
// base class destroy not needed, since the GenericServlet.destroy
// is an empty method
-
+
// stop listening for plugins
if ( operationsTracker != null )
{
@@ -374,7 +376,7 @@
//---------- internal
- protected boolean handleAction( HttpServletRequest req, HttpServletResponse resp ) throws IOException
+ protected boolean handleAction( HttpServletRequest req, HttpServletResponse resp ) throws IOException, ServletException
{
// check action
String actionName = AbstractWebConsolePlugin.getParameter( req, Util.PARAM_ACTION );
@@ -589,7 +591,7 @@
"bindHttpService: Already bound to an HTTP Service, ignoring further services" );
return;
}
-
+
Dictionary config = getConfiguration();
// get authentication details
Added: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/internal/servlet/RenderBridge.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/internal/servlet/RenderBridge.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/apache/felix/webconsole/internal/servlet/RenderBridge.java 2009-07-06 09:12:53 UTC (rev 90828)
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.felix.webconsole.internal.servlet;
+
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.text.MessageFormat;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.felix.webconsole.AbstractWebConsolePlugin;
+import org.apache.felix.webconsole.Render;
+import org.jboss.osgi.service.webconsole.internal.plugins.PluginHelper;
+
+
+public class RenderBridge extends AbstractWebConsolePlugin
+{
+
+ /** Pseudo class version ID to keep the IDE quite. */
+ private static final long serialVersionUID = 1L;
+
+ private final Render render;
+
+
+ RenderBridge( Render render )
+ {
+ this.render = render;
+ }
+
+
+ @Override
+ protected String getHeader()
+ {
+ return PluginHelper.getHeader();
+ }
+
+ @Override
+ protected void endResponse(HttpServletRequest request, PrintWriter pw)
+ {
+ String appRoot = (String)request.getAttribute(OsgiManager.ATTR_APP_ROOT);
+ String footer = MessageFormat.format(PluginHelper.getFooter(), new Object[]{ appRoot });
+ pw.println(footer);
+ }
+
+ public Render getRender()
+ {
+ return render;
+ }
+
+
+ public String getTitle()
+ {
+ return render.getLabel();
+ }
+
+
+ public String getLabel()
+ {
+ return render.getName();
+ }
+
+
+ protected void renderContent( HttpServletRequest request, HttpServletResponse response ) throws ServletException,
+ IOException
+ {
+ render.render( request, response );
+ }
+
+}
Modified: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/WebConsole.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/WebConsole.java 2009-07-06 08:25:35 UTC (rev 90827)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/WebConsole.java 2009-07-06 09:12:53 UTC (rev 90828)
@@ -23,12 +23,11 @@
//$Id$
-import org.apache.felix.webconsole.Render;
import org.apache.felix.webconsole.internal.compendium.ComponentConfigurationPrinter;
+import org.apache.felix.webconsole.internal.compendium.ComponentsServlet;
import org.apache.felix.webconsole.internal.core.InstallAction;
import org.apache.felix.webconsole.internal.core.SetStartLevelAction;
import org.apache.felix.webconsole.internal.misc.ConfigurationRender;
-import org.apache.felix.webconsole.internal.misc.ShellServlet;
import org.apache.felix.webconsole.internal.obr.BundleRepositoryRender;
import org.apache.felix.webconsole.internal.obr.InstallFromRepoAction;
import org.apache.felix.webconsole.internal.obr.RefreshRepoAction;
@@ -38,15 +37,14 @@
import org.jboss.osgi.service.webconsole.internal.plugins.BundlesPlugin;
import org.jboss.osgi.service.webconsole.internal.plugins.ConfigManagerPlugin;
import org.jboss.osgi.service.webconsole.internal.plugins.EventAdminPlugin;
-import org.jboss.osgi.service.webconsole.internal.plugins.JBossRenderBridge;
import org.jboss.osgi.service.webconsole.internal.plugins.LicensePlugin;
+import org.jboss.osgi.service.webconsole.internal.plugins.LogServicePlugin;
import org.osgi.framework.BundleContext;
/**
* Web Console integration
*
- * Improve console extensibility
- * https://issues.apache.org/jira/browse/FELIX-1013
+ * Improve console extensibility https://issues.apache.org/jira/browse/FELIX-1013
*
* @author thomas.diesler(a)jboss.com
* @since 12-Mar-2009
@@ -72,29 +70,47 @@
@Override
protected String[] getPluginClasses()
{
- return new String[] {
- BundlesPlugin.class.getName(),
- ConfigManagerPlugin.class.getName(),
- EventAdminPlugin.class.getName(),
- LicensePlugin.class.getName(),
-
- ComponentConfigurationPrinter.class.getName(),
- InstallAction.class.getName(),
- SetStartLevelAction.class.getName(),
- ConfigurationRender.class.getName(),
- BundleRepositoryRender.class.getName(),
- InstallFromRepoAction.class.getName(),
- RefreshRepoAction.class.getName(),
- GCAction.class.getName(),
- VMStatPlugin.class.getName()
- };
+ /*
+ PLUGIN_CLASSES =
+ "org.apache.felix.webconsole.internal.compendium.ComponentConfigurationPrinter",
+ "org.apache.felix.webconsole.internal.compendium.ComponentsServlet",
+ "org.apache.felix.webconsole.internal.compendium.ConfigManager",
+ "org.apache.felix.webconsole.internal.compendium.LogServlet",
+ "org.apache.felix.webconsole.internal.core.BundlesServlet",
+ "org.apache.felix.webconsole.internal.core.InstallAction",
+ "org.apache.felix.webconsole.internal.core.SetStartLevelAction",
+ "org.apache.felix.webconsole.internal.deppack.DepPackServlet",
+ "org.apache.felix.webconsole.internal.misc.EventAdminServlet",
+ "org.apache.felix.webconsole.internal.misc.LicenseServlet",
+ "org.apache.felix.webconsole.internal.misc.ConfigurationRender",
+ "org.apache.felix.webconsole.internal.misc.ShellServlet",
+ "org.apache.felix.webconsole.internal.obr.BundleRepositoryRender",
+ "org.apache.felix.webconsole.internal.obr.InstallFromRepoAction",
+ "org.apache.felix.webconsole.internal.obr.RefreshRepoAction",
+ "org.apache.felix.webconsole.internal.system.GCAction",
+ "org.apache.felix.webconsole.internal.system.VMStatPlugin"
+ */
+
+ String[] PLUGIN_CLASSES = new String[] {
+ ComponentConfigurationPrinter.class.getName(),
+ //ComponentsServlet.class.getName(),
+ ConfigManagerPlugin.class.getName(),
+ LogServicePlugin.class.getName(),
+ BundlesPlugin.class.getName(),
+ InstallAction.class.getName(),
+ SetStartLevelAction.class.getName(),
+ // DepPackServlet.class.getName(),
+ EventAdminPlugin.class.getName(),
+ LicensePlugin.class.getName(),
+ ConfigurationRender.class.getName(),
+ // ShellServlet.class.getName(),
+ BundleRepositoryRender.class.getName(),
+ InstallFromRepoAction.class.getName(),
+ RefreshRepoAction.class.getName(),
+ GCAction.class.getName(),
+ VMStatPlugin.class.getName()
+ };
+
+ return PLUGIN_CLASSES;
}
-
- @Override
- protected void bindRender(Render render)
- {
- JBossRenderBridge bridge = new JBossRenderBridge(render);
- bridge.activate(bundleContext);
- bindServlet(render.getName(), bridge);
- }
}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/ConfigManagerPlugin.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/ConfigManagerPlugin.java 2009-07-06 08:25:35 UTC (rev 90827)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/ConfigManagerPlugin.java 2009-07-06 09:12:53 UTC (rev 90828)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.service.webconsole.internal.plugins;
-
-//$Id$
-
-import java.io.PrintWriter;
-import java.text.MessageFormat;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.felix.webconsole.internal.compendium.ConfigManager;
-import org.apache.felix.webconsole.internal.servlet.OsgiManager;
-
-/**
- * A Console plugin
- *
- * @author thomas.diesler(a)jboss.com
- * @since 12-Mar-2009
- */
-public class ConfigManagerPlugin extends ConfigManager
-{
- private static final long serialVersionUID = 1L;
-
- @Override
- protected String getHeader()
- {
- return PluginHelper.getHeader();
- }
-
- @Override
- protected void endResponse(HttpServletRequest request, PrintWriter pw)
- {
- String appRoot = (String)request.getAttribute(OsgiManager.ATTR_APP_ROOT);
- String footer = MessageFormat.format(PluginHelper.getFooter(), new Object[]{ appRoot });
- pw.println(footer);
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/ConfigManagerPlugin.java (from rev 90826, projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/ConfigManagerPlugin.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/ConfigManagerPlugin.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/ConfigManagerPlugin.java 2009-07-06 09:12:53 UTC (rev 90828)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.service.webconsole.internal.plugins;
+
+//$Id$
+
+import java.io.PrintWriter;
+import java.text.MessageFormat;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.felix.webconsole.internal.compendium.ConfigManager;
+import org.apache.felix.webconsole.internal.servlet.OsgiManager;
+
+/**
+ * A Console plugin
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 12-Mar-2009
+ */
+public class ConfigManagerPlugin extends ConfigManager
+{
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected String getHeader()
+ {
+ return PluginHelper.getHeader();
+ }
+
+ @Override
+ protected void endResponse(HttpServletRequest request, PrintWriter pw)
+ {
+ String appRoot = (String)request.getAttribute(OsgiManager.ATTR_APP_ROOT);
+ String footer = MessageFormat.format(PluginHelper.getFooter(), new Object[]{ appRoot });
+ pw.println(footer);
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/JBossRenderBridge.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/JBossRenderBridge.java 2009-07-06 08:25:35 UTC (rev 90827)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/JBossRenderBridge.java 2009-07-06 09:12:53 UTC (rev 90828)
@@ -1,90 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.service.webconsole.internal.plugins;
-
-//$Id$
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.text.MessageFormat;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.felix.webconsole.AbstractWebConsolePlugin;
-import org.apache.felix.webconsole.Render;
-import org.apache.felix.webconsole.internal.servlet.OsgiManager;
-
-/**
- * A copy of the org.apache.felix.webconsole.internal.servlet.RenderBridge
- * which does not have a public ctor.
- *
- * We replace the header and footer.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 26-Mar-2009
- */
-@SuppressWarnings("serial")
-public class JBossRenderBridge extends AbstractWebConsolePlugin
-{
- private final Render render;
-
- public JBossRenderBridge(Render render)
- {
- this.render = render;
- }
-
- @Override
- protected String getHeader()
- {
- return PluginHelper.getHeader();
- }
-
- @Override
- protected void endResponse(HttpServletRequest request, PrintWriter pw)
- {
- String appRoot = (String)request.getAttribute(OsgiManager.ATTR_APP_ROOT);
- String footer = MessageFormat.format(PluginHelper.getFooter(), new Object[]{ appRoot });
- pw.println(footer);
- }
-
- public Render getRender()
- {
- return render;
- }
-
- public String getTitle()
- {
- return render.getLabel();
- }
-
- public String getLabel()
- {
- return render.getName();
- }
-
- protected void renderContent(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
- {
- render.render(request, response);
- }
-}
Added: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/LogServicePlugin.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/LogServicePlugin.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/LogServicePlugin.java 2009-07-06 09:12:53 UTC (rev 90828)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.service.webconsole.internal.plugins;
+
+//$Id: BundlesPlugin.java 86576 2009-04-01 07:17:02Z thomas.diesler(a)jboss.com $
+
+import java.io.PrintWriter;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.felix.webconsole.internal.compendium.LogServlet;
+
+/**
+ * A Console plugin
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 12-Mar-2009
+ */
+public class LogServicePlugin extends LogServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected String getHeader()
+ {
+ return PluginHelper.getHeader();
+ }
+
+ @Override
+ protected void endResponse(HttpServletRequest request, PrintWriter pw)
+ {
+ // Footer redered before content in bundle plugin
+ // https://issues.apache.org/jira/browse/FELIX-1020
+
+ //String appRoot = (String)request.getAttribute(OsgiManager.ATTR_APP_ROOT);
+ //String footer = MessageFormat.format(PluginHelper.getFooter(), new Object[]{ appRoot });
+ //pw.println(footer);
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/PluginHelper.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/PluginHelper.java 2009-07-06 08:25:35 UTC (rev 90827)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/java/org/jboss/osgi/service/webconsole/internal/plugins/PluginHelper.java 2009-07-06 09:12:53 UTC (rev 90828)
@@ -31,9 +31,9 @@
*/
public abstract class PluginHelper
{
- static String getHeader()
+ public static String getHeader()
{
- String htmlHeader = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
+ String HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
+ "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"xhtml1-transitional.dtd\">"
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\">"
+ "<head>"
@@ -59,14 +59,17 @@
+ "<p>"
+ "<a target=\"_blank\" href=\"{3}\" title=\"{1}\"><img src=\"{5}/res/imgs/jboss_logo.png\" width=\"123\" height=\"103\" border=\"0\"></a>"
+ "</p></div>";
- return htmlHeader;
+
+ return HEADER;
}
- static String getFooter()
+ public static String getFooter()
{
- return "<img src=\"{0}/res/imgs/logo.png\" width=\"55\" height=\"21\" border=\"0\"> "
+ String FOOTER = "<img src=\"{0}/res/imgs/logo.png\" width=\"55\" height=\"21\" border=\"0\"> "
+ "<a target=\"_blank\" href=\"http://felix.apache.org/site/apache-felix-web-console.html\">Apache Felix Web Console</a>"
+ "</body>"
+ "</html>";
+
+ return FOOTER;
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/resources/res/ui/admin.css
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/resources/res/ui/admin.css 2009-07-06 08:25:35 UTC (rev 90827)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/resources/res/ui/admin.css 2009-07-06 09:12:53 UTC (rev 90828)
@@ -21,8 +21,7 @@
background-color: white;
border-collapse: collapse;
padding: 0px;
- margin: 30px 0 30px 30px;
- width: 957px;
+ margin: 30px;
position: absolute;
text-align: left;
border-color: black;
@@ -33,7 +32,6 @@
/* color: #ffffff; */
margin: 0px 0px 26px 0px;
padding: 0px;
- width: 957px;
height: 100px;
}
@@ -157,7 +155,6 @@
margin: 0px;
margin-top: 26px;
margin-bottom: 26px;
- /* width: 718px; */
text-align: left;
}
@@ -222,7 +219,6 @@
border: 1px solid #000000;
padding: 0px;
margin: 0px;
- width: 960px;
}
.toolcell {
@@ -231,7 +227,6 @@
line-height: 10px;
background-color: #000000;
height: 18px;
- /* width: 960px; */
padding: 0px;
padding-bottom: 1px;
text-align: left;
@@ -340,7 +335,7 @@
background-color: #6181A9;
}
*/
-.techcontentcell { /* width: 718px; */
+.techcontentcell {
border: 0px solid #000000;
border-top: 1px solid #000000;
}
@@ -348,43 +343,10 @@
.relatedcell {
border-left: 1px solid #000000;
border-top: 1px solid #000000;
- width: 239px;
background-color: #EBF0F6;
}
-/*
-.claimcell {
- width: 715px;
- font-size: 10px;
- color: #ffffff;
- line-height: 10px;
- background-color: #000000;
- height: 18px;
- padding: 0px;
- padding-bottom: 1px;
-}
-
-.claimcell A:link {
- color: #C5E2EE;
- text-decoration: none;
-}
-
-.claimcell A:visited {
- color: #C5E2EE;
- text-decoration: none;
-}
-
-.claimcell A:hover {
- color: #99FF33;
- text-decoration: none;
- border-bottom: 1px solid;
-}
-
-.claimcell A:active {
- color: #FFFFFF;
- text-decoration: none;
-}
-*/ /* CENTRAL CONTENT AREA STYLING */
+/* CENTRAL CONTENT AREA STYLING */
.content {
position: relative;
margin: 25px;
@@ -572,7 +534,16 @@
vertical-align: middle;
padding-right: 10px;
padding-top: 8px;
+ color: #F0F0F0;
+ font-size: 10px;
}
+div.buttons select {
+ font-family: Verdana, Arial, Helvetica, san-serif;
+ font-size: 9px;
+ font-weight: normal;
+ display: inline;
+ float:none;
+}
div.button {
display: inline-block;
margin-left: 10px;
Modified: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/resources/res/ui/bundles.js
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/resources/res/ui/bundles.js 2009-07-06 08:25:35 UTC (rev 90827)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/resources/res/ui/bundles.js 2009-07-06 09:12:53 UTC (rev 90828)
@@ -55,6 +55,9 @@
}
function actionButton( /* Element */ parent, /* string */ id, /* Obj */ action ) {
+ if ( !action.enabled ) {
+ return;
+ }
var enabled = action.enabled;
var op = action.link;
var opLabel = action.name;
@@ -102,6 +105,8 @@
parent.appendChild( td( null, null, [ text( id ) ] ) );
parent.appendChild( td( null, null, [ inputElement, text(" "), titleElement ] ) );
+ parent.appendChild( td( null, null, [ text( dataEntry.version ) ] ) );
+ parent.appendChild( td( null, null, [ text( dataEntry.symbolicName ) ] ) );
parent.appendChild( td( null, null, [ text( state ) ] ) );
var actionsTd = td( null, null );
var div = createElement("div", null, {
@@ -207,7 +212,7 @@
function renderBundles(data) {
$(document).ready(function(){
- renderView( ["Id", "Name", "Status", "Actions"],
+ renderView( ["Id", "Name", "Version", "Symbolic Name", "Status", "Actions"],
"<input type='hidden' name='action' value='install'/>" +
"<input class='fileinput' type='file' name='bundlefile' style='margin-left:10px'/>" +
" - Start <input class='checkradio' type='checkbox' name='bundlestart' value='start' style='vertical-align:middle;'/>" +
@@ -228,7 +233,7 @@
$("#plugin_table").tablesorter({
headers: {
0: { sorter:"digit"},
- 3: { sorter: false }
+ 5: { sorter: false }
},
sortList: [[1,0]],
textExtraction:extractMethod
Added: projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/resources/res/ui/logs.js
===================================================================
--- projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/resources/res/ui/logs.js (rev 0)
+++ projects/jboss-osgi/projects/bundles/webconsole/trunk/src/main/resources/res/ui/logs.js 2009-07-06 09:12:53 UTC (rev 90828)
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+function renderStatusLine() {
+ $("#plugin_content").append( "<div class='fullwidth'><div class='statusline'/></div>" );
+}
+
+function renderView( /* Array of String */ columns, /* String */ buttons ) {
+ renderStatusLine();
+ renderButtons(buttons);
+ var txt = "<div class='table'><table id='plugin_table' class='tablelayout'><thead><tr>";
+ for ( var name in columns ) {
+ txt = txt + "<th class='col_" + columns[name] + "'>" + columns[name] + "</th>";
+ }
+ txt = txt + "</tr></thead><tbody></tbody></table></div>";
+ $("#plugin_content").append( txt );
+ renderButtons(buttons);
+ renderStatusLine();
+}
+
+function renderButtons( buttons ) {
+ $("#plugin_content").append( "<form method='post' enctype='multipart/form-data'><div class='fullwidth'><div class='buttons'>" +
+ buttons + "</div></div></form>" );
+}
+
+function renderData( eventData ) {
+ $(".statusline").empty().append(eventData.status);
+ $("#plugin_table > tbody > tr").remove();
+ for ( var idx in eventData.data ) {
+ entry( eventData.data[idx] );
+ }
+ $("#plugin_table").trigger("update");
+}
+
+function entry( /* Object */ dataEntry ) {
+ var trElement = tr( null, { id: "entry" + dataEntry.id } );
+ entryInternal( trElement, dataEntry );
+ $("#plugin_table > tbody").append(trElement);
+}
+
+function entryInternal( /* Element */ parent, /* Object */ dataEntry ) {
+ var id = dataEntry.id;
+ var message = dataEntry.message;
+ var level = dataEntry.level;
+ var exception = dataEntry.exception;
+ var service = dataEntry.service;
+
+ parent.appendChild( td( null, null, [ text( printDate(dataEntry.received) ) ] ) );
+ parent.appendChild( td( null, null, [ text( level ) ] ) );
+ parent.appendChild( td( null, null, [ text( message ) ] ) );
+ parent.appendChild( td( null, null, [ text( service ) ] ) );
+ parent.appendChild( td( null, null, [ text( exception ) ] ) );
+}
+
+/* displays a date in the user's local timezone */
+function printDate(time) {
+ var date = time ? new Date(time) : new Date();
+ return date.toLocaleString();
+}
+
+function loadData() {
+ $.get(pluginRoot + "/data.json", { "minLevel":$("#minLevel").val()}, function(data) {
+ renderData(data);
+ }, "json");
+}
+
+function renderLogs() {
+ $(document).ready(function(){
+ renderView( ["Received", "Level", "Message", "Service", "Exception"],
+ "<span>Severity at least: <select id='minLevel'><option value='1'>ERROR</option>" +
+ "<option value='2'>WARN</option><option value='3'>INFO</option><option value='4' selected='selected'>DEBUG</option></select></span> "+
+ "<button class='reloadButton' type='button' name='reload'>Reload</button>");
+ loadData();
+
+ $("#plugin_table").tablesorter();
+ $(".reloadButton").click(loadData);
+ $("#minLevel").change(function() {
+ $.post(pluginRoot, { "minLevel":$("#minLevel").val()}, function(data) {
+ renderData(data);
+ }, "json");
+ });
+ });
+}
\ No newline at end of file
16 years, 6 months
JBoss-OSGI SVN: r90823 - projects/jboss-osgi/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-06 02:18:28 -0400 (Mon, 06 Jul 2009)
New Revision: 90823
Modified:
projects/jboss-osgi/trunk/pom.xml
Log:
izpack-4.3.1
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-07-05 22:56:34 UTC (rev 90822)
+++ projects/jboss-osgi/trunk/pom.xml 2009-07-06 06:18:28 UTC (rev 90823)
@@ -32,7 +32,7 @@
<version.apache.felix.http.jetty>1.0.1</version.apache.felix.http.jetty>
<version.apache.felix.log>1.0.0</version.apache.felix.log>
<version.apache.felix.metatype>1.0.2</version.apache.felix.metatype>
- <version.izpack>4.2.0</version.izpack>
+ <version.izpack>4.3.1</version.izpack>
<version.javax.servlet>2.4</version.javax.servlet>
<version.jboss.deployers>2.0.5.GA</version.jboss.deployers>
<version.jboss.jdocbook.plugin>2.1.2</version.jboss.jdocbook.plugin>
16 years, 6 months
JBoss-OSGI SVN: r90813 - in projects/jboss-osgi/trunk/blueprint: testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-03 09:25:35 -0400 (Fri, 03 Jul 2009)
New Revision: 90813
Modified:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TArgument.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBean.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBlueprint.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComponent.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TProperty.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRef.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TReference.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRegistrationListener.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TService.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServicePropertyEntry.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServiceReference.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TTypeConverters.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/OSGI-INF/blueprint/basic-service.xml
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-beans.xml
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-service.xml
Log:
More annotation based parsing
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TArgument.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TArgument.java 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TArgument.java 2009-07-03 13:25:35 UTC (rev 90813)
@@ -27,7 +27,11 @@
import java.util.ArrayList;
import java.util.List;
+import javax.xml.bind.annotation.XmlType;
+import org.jboss.osgi.blueprint.BlueprintContext;
+
+
/**
*
* An argument used to create an object defined by a <bean> component. The <argument> elements are the arguments for the bean class constructor or passed to the bean
@@ -63,6 +67,7 @@
*
*
*/
+@XmlType(name = "Targument", namespace = BlueprintContext.XMLNS_BLUEPRINT, propOrder = { "description" })
public class TArgument
{
protected String description;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBean.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBean.java 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBean.java 2009-07-03 13:25:35 UTC (rev 90813)
@@ -40,7 +40,7 @@
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
*/
-@XmlType(name = "Tbean", namespace = BlueprintContext.XMLNS_BLUEPRINT)
+@XmlType(name = "Tbean", namespace = BlueprintContext.XMLNS_BLUEPRINT, propOrder = { "description", "properties", "arguments" })
public class TBean extends TComponent
{
protected String description;
@@ -65,7 +65,7 @@
this.description = value;
}
- @XmlElement(name = "property", namespace = BlueprintContext.XMLNS_BLUEPRINT)
+ @XmlElement(name = "property")
public List<TProperty> getProperties()
{
return properties;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBlueprint.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBlueprint.java 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBlueprint.java 2009-07-03 13:25:35 UTC (rev 90813)
@@ -59,7 +59,7 @@
*/
@JBossXmlSchema(namespace = BlueprintContext.XMLNS_BLUEPRINT, elementFormDefault = XmlNsForm.QUALIFIED)
@XmlRootElement(name = "blueprint", namespace = BlueprintContext.XMLNS_BLUEPRINT)
-@XmlType(name = "Tblueprint", namespace = BlueprintContext.XMLNS_BLUEPRINT, propOrder = { "description", "typeConverters" })
+@XmlType(name = "Tblueprint", namespace = BlueprintContext.XMLNS_BLUEPRINT, propOrder = { "description", "typeConverters", "components" })
public class TBlueprint
{
protected String description;
@@ -92,9 +92,10 @@
this.typeConverters = value;
}
- @XmlElements( { @XmlElement(name = "bean", namespace = BlueprintContext.XMLNS_BLUEPRINT, type = TBean.class),
- @XmlElement(name = "service", namespace = BlueprintContext.XMLNS_BLUEPRINT, type = TService.class),
- @XmlElement(name = "reference", namespace = BlueprintContext.XMLNS_BLUEPRINT, type = TReference.class) })
+ @XmlElements( {
+ @XmlElement(name = "bean", namespace = BlueprintContext.XMLNS_BLUEPRINT, type = TBean.class),
+ @XmlElement(name = "service", namespace = BlueprintContext.XMLNS_BLUEPRINT, type = TService.class),
+ @XmlElement(name = "reference", namespace = BlueprintContext.XMLNS_BLUEPRINT, type = TReference.class) })
public List<TComponent> getComponents()
{
if (components == null)
@@ -146,8 +147,8 @@
return compMetadata;
}
- @XmlAttribute(name = "default-lazy-init", namespace = BlueprintContext.XMLNS_BLUEPRINT)
- public Boolean isDefaultLazyInit()
+ @XmlAttribute
+ public Boolean getDefaultLazyInit()
{
return defaultLazyInit;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComponent.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComponent.java 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComponent.java 2009-07-03 13:25:35 UTC (rev 90813)
@@ -45,7 +45,7 @@
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
*/
-@XmlType(name = "TComponent", namespace = BlueprintContext.XMLNS_BLUEPRINT)
+@XmlType(name = "Tcomponent", namespace = BlueprintContext.XMLNS_BLUEPRINT)
public abstract class TComponent
{
protected String id;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TProperty.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TProperty.java 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TProperty.java 2009-07-03 13:25:35 UTC (rev 90813)
@@ -64,7 +64,7 @@
*
*
*/
-@XmlType(name = "TProperty", namespace = BlueprintContext.XMLNS_BLUEPRINT)
+@XmlType(name = "Tproperty", namespace = BlueprintContext.XMLNS_BLUEPRINT, propOrder = { "description" })
public class TProperty
{
protected String description;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRef.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRef.java 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRef.java 2009-07-03 13:25:35 UTC (rev 90813)
@@ -21,6 +21,11 @@
*/
package org.jboss.osgi.blueprint.parser.xb;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.osgi.blueprint.BlueprintContext;
+
//$Id$
/**
@@ -48,27 +53,17 @@
*
*
*/
+@XmlType(name = "Tref", namespace = BlueprintContext.XMLNS_BLUEPRINT)
public class TRef
{
protected String component;
- /**
- * Gets the value of the component property.
- *
- * @return possible object is {@link String }
- *
- */
+ @XmlAttribute
public String getComponent()
{
return component;
}
- /**
- * Sets the value of the component property.
- *
- * @param value allowed object is {@link String }
- *
- */
public void setComponent(String value)
{
this.component = value;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TReference.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TReference.java 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TReference.java 2009-07-03 13:25:35 UTC (rev 90813)
@@ -58,7 +58,10 @@
*
*
*/
-@XmlType(name = "Treference", namespace = BlueprintContext.XMLNS_BLUEPRINT)
+
+// [JBXB-210] Property order cannot be defined on super type
+// https://jira.jboss.org/jira/browse/JBXB-210
+@XmlType(name = "Treference", namespace = BlueprintContext.XMLNS_BLUEPRINT, propOrder = { "description" })
public class TReference extends TServiceReference
{
protected BigInteger timeout;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRegistrationListener.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRegistrationListener.java 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRegistrationListener.java 2009-07-03 13:25:35 UTC (rev 90813)
@@ -26,7 +26,11 @@
import java.util.ArrayList;
import java.util.List;
+import javax.xml.bind.annotation.XmlType;
+import org.jboss.osgi.blueprint.BlueprintContext;
+
+
/**
*
*
@@ -58,6 +62,10 @@
*
*
*/
+
+// [JBXB-211] @XmlType.propOrder required with no schema sequence
+// https://jira.jboss.org/jira/browse/JBXB-211
+@XmlType(name = "TregistrationListener", namespace = BlueprintContext.XMLNS_BLUEPRINT, propOrder = { "bean" })
public class TRegistrationListener
{
protected TBean bean;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TService.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TService.java 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TService.java 2009-07-03 13:25:35 UTC (rev 90813)
@@ -42,7 +42,8 @@
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
*/
-@XmlType(name = "Tservice", namespace = BlueprintContext.XMLNS_BLUEPRINT)
+@XmlType(name = "Tservice", namespace = BlueprintContext.XMLNS_BLUEPRINT,
+ propOrder = { "description", "interfaceNames", "serviceProperties", "registrationListeners", "bean", "ref" })
public class TService extends TComponent
{
protected String description;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServicePropertyEntry.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServicePropertyEntry.java 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServicePropertyEntry.java 2009-07-03 13:25:35 UTC (rev 90813)
@@ -21,6 +21,10 @@
*/
package org.jboss.osgi.blueprint.parser.xb;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.osgi.blueprint.BlueprintContext;
+
// $Id$
/**
@@ -28,6 +32,7 @@
* attributes.
*
*/
+@XmlType(name = "TservicePropertyEntry", namespace = BlueprintContext.XMLNS_BLUEPRINT, propOrder = { "value" })
public class TServicePropertyEntry
{
protected String key;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServiceReference.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServiceReference.java 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServiceReference.java 2009-07-03 13:25:35 UTC (rev 90813)
@@ -28,9 +28,12 @@
import java.util.List;
import java.util.Map;
+import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
+import org.jboss.osgi.blueprint.BlueprintContext;
+
/**
* TserviceReference is the base element type used for <reference>, <ref-set>, and <ref-list> elements. This type defines all of the characteristics common to both
* sorts of references.
@@ -63,6 +66,7 @@
*
*
*/
+@XmlType(name = "TserviceReference", namespace = BlueprintContext.XMLNS_BLUEPRINT, propOrder = { "description" })
public class TServiceReference extends TComponent
{
protected String description;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TTypeConverters.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TTypeConverters.java 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TTypeConverters.java 2009-07-03 13:25:35 UTC (rev 90813)
@@ -26,6 +26,8 @@
import java.util.ArrayList;
import java.util.List;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlType;
import org.jboss.osgi.blueprint.BlueprintContext;
@@ -64,6 +66,10 @@
{
protected List<Object> components;
+ @XmlElements( {
+ @XmlElement(name = "bean", namespace = BlueprintContext.XMLNS_BLUEPRINT, type = TBean.class),
+ @XmlElement(name = "reference", namespace = BlueprintContext.XMLNS_BLUEPRINT, type = TReference.class),
+ @XmlElement(name = "ref", namespace = BlueprintContext.XMLNS_BLUEPRINT, type = TRef.class)})
public List<Object> getComponents()
{
if (components == null)
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-07-03 13:25:35 UTC (rev 90813)
@@ -73,7 +73,7 @@
String defaultInitMethod = blueprint.getDefaultInitMethod();
assertEquals("defaultInitMethod", defaultInitMethod);
- Boolean defaultLazyInit = blueprint.isDefaultLazyInit();
+ Boolean defaultLazyInit = blueprint.getDefaultLazyInit();
assertEquals(Boolean.FALSE, defaultLazyInit);
long defaultTimeout = blueprint.getDefaultTimeout().longValue();
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-07-03 13:25:35 UTC (rev 90813)
@@ -59,9 +59,11 @@
TBean beanA = (TBean)compList.get(0);
assertEquals(BeanA.class.getName(), beanA.getClassName());
assertEquals("beanA", beanA.getId());
+ assertEquals("BeanA Description", beanA.getDescription());
TBean beanB = (TBean)compList.get(1);
assertEquals(BeanB.class.getName(), beanB.getClassName());
assertEquals("beanB", beanB.getId());
+ assertEquals("BeanB Description", beanB.getDescription());
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java 2009-07-03 13:25:35 UTC (rev 90813)
@@ -53,7 +53,7 @@
// assert default attributes
assertEquals("default-availability: mandatory", TAvailability.mandatory, blueprint.getDefaultAvailability());
assertEquals("default-timeout: 300000", new BigInteger("300000"), blueprint.getDefaultTimeout());
- assertEquals("default-lazy-init: FALSE", Boolean.FALSE, blueprint.isDefaultLazyInit());
+ assertEquals("default-lazy-init: FALSE", Boolean.FALSE, blueprint.getDefaultLazyInit());
assertNull("default-init-method: null", blueprint.getDefaultInitMethod());
assertNull("default-destroy-method: null", blueprint.getDefaultDestroyMethod());
}
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-07-03 13:25:35 UTC (rev 90813)
@@ -50,7 +50,7 @@
public class BasicServiceParserTestCase extends OSGiTest
{
@Test
- public void testBasicBeans() throws Exception
+ public void testBasicService() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-service.xml");
TBlueprint blueprint = new BlueprintParser(new MockBlueprintContext()).parse(xmlURL);
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/OSGI-INF/blueprint/basic-service.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/OSGI-INF/blueprint/basic-service.xml 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/OSGI-INF/blueprint/basic-service.xml 2009-07-03 13:25:35 UTC (rev 90813)
@@ -1,5 +1,5 @@
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd schema/blueprint.xsd">
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<bean id="beanA" class="org.jboss.test.osgi.blueprint.container.bundle.BeanA">
<property name="mbeanServer" ref="mbeanService"/>
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-07-03 13:25:35 UTC (rev 90813)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 blueprint.xsd "
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"
default-availability="mandatory" default-destroy-method="defaultDestroyMethod" default-init-method="defaultInitMethod" default-lazy-init="false" default-timeout="300000">
<description>blueprint description</description>
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-beans.xml 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-beans.xml 2009-07-03 13:25:35 UTC (rev 90813)
@@ -1,10 +1,12 @@
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd schema/blueprint.xsd">
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<bean id="beanA" class="org.jboss.test.osgi.blueprint.parser.comp.BeanA">
+ <description>BeanA Description</description>
</bean>
<bean id="beanB" class="org.jboss.test.osgi.blueprint.parser.comp.BeanB">
+ <description>BeanB Description</description>
<property name="beanA" ref="beanA"/>
</bean>
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-service.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-service.xml 2009-07-03 12:03:39 UTC (rev 90812)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-service.xml 2009-07-03 13:25:35 UTC (rev 90813)
@@ -1,5 +1,5 @@
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd schema/blueprint.xsd">
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<bean id="beanA" class="org.jboss.test.osgi.blueprint.parser.comp.BeanA">
</bean>
16 years, 6 months
JBoss-OSGI SVN: r90812 - projects/jboss-osgi/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-03 08:03:39 -0400 (Fri, 03 Jul 2009)
New Revision: 90812
Modified:
projects/jboss-osgi/trunk/pom.xml
Log:
Update to kernel-2.0.5.GA
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-07-03 12:02:53 UTC (rev 90811)
+++ projects/jboss-osgi/trunk/pom.xml 2009-07-03 12:03:39 UTC (rev 90812)
@@ -58,7 +58,7 @@
<version.jboss.osgi.runtime.knopflerfish>1.0.0.Beta2</version.jboss.osgi.runtime.knopflerfish>
<version.jboss.osgi.spi>1.0.0-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.webconsole>1.0.0.Beta2</version.jboss.osgi.webconsole>
- <version.jboss.osgi.xml.binding>2.0.0</version.jboss.osgi.xml.binding>
+ <version.jboss.osgi.xml.binding>2.0.1-SNAPSHOT</version.jboss.osgi.xml.binding>
<version.junit>4.6</version.junit>
<version.osgi>r4v41</version.osgi>
</properties>
16 years, 6 months
JBoss-OSGI SVN: r90811 - projects/jboss-osgi/projects/bundles/microcontainer/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-03 08:02:53 -0400 (Fri, 03 Jul 2009)
New Revision: 90811
Modified:
projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
Log:
Update to kernel-2.0.5.GA
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-07-03 11:30:20 UTC (rev 90810)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-07-03 12:02:53 UTC (rev 90811)
@@ -20,7 +20,7 @@
<!-- Properties -->
<properties>
<version.jboss.deployers>2.0.5.SP1</version.jboss.deployers>
- <version.jboss.microcontainer>2.0.4.GA</version.jboss.microcontainer>
+ <version.jboss.microcontainer>2.0.5.GA</version.jboss.microcontainer>
<version.jboss.osgi.apache.xerces>2.9.1</version.jboss.osgi.apache.xerces>
<version.jboss.osgi.common>1.0.0.Beta2</version.jboss.osgi.common>
<version.jboss.osgi.deployers>1.0.0.Beta2</version.jboss.osgi.deployers>
16 years, 6 months
JBoss-OSGI SVN: r90806 - in projects/jboss-osgi/trunk/blueprint: impl/src/main/java/org/jboss/osgi/blueprint/parser and 5 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-03 04:27:52 -0400 (Fri, 03 Jul 2009)
New Revision: 90806
Modified:
projects/jboss-osgi/trunk/blueprint/impl/pom.xml
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/SchemaResolverParser.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TAvailability.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBlueprint.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServiceReference.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TTypeConverters.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/log4j.xml
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-root.xml
Log:
More annotation based parsing
Modified: projects/jboss-osgi/trunk/blueprint/impl/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/pom.xml 2009-07-03 07:40:51 UTC (rev 90805)
+++ projects/jboss-osgi/trunk/blueprint/impl/pom.xml 2009-07-03 08:27:52 UTC (rev 90806)
@@ -79,6 +79,7 @@
org.osgi.service.log,
org.osgi.util.tracker,
org.w3c.dom,
+ org.xml.sax,
</Import-Package>
</instructions>
</configuration>
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/SchemaResolverParser.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/SchemaResolverParser.java 2009-07-03 07:40:51 UTC (rev 90805)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/SchemaResolverParser.java 2009-07-03 08:27:52 UTC (rev 90806)
@@ -23,19 +23,16 @@
//$Id$
-import static org.jboss.osgi.blueprint.BlueprintContext.XMLNS_BLUEPRINT;
-
import java.net.URL;
import org.jboss.osgi.blueprint.BlueprintContext;
import org.jboss.osgi.blueprint.BlueprintException;
import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
+import org.jboss.util.xml.JBossEntityResolver;
import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
-import org.osgi.service.log.LogService;
/**
* The Blueprint descriptor parser.
@@ -45,11 +42,8 @@
*/
public class SchemaResolverParser implements JBossXBParser
{
- private SchemaBindingResolver resolver;
-
public SchemaResolverParser(BlueprintContext context)
{
- resolver = new BlueprintSchemaResolver(context);
}
/*
@@ -67,10 +61,22 @@
Thread.currentThread().setContextClassLoader(bundleCL);
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setSchemaValidation(true);
unmarshaller.setNamespaceAware(true);
unmarshaller.setValidation(true);
- TBlueprint tBlueprint = (TBlueprint)unmarshaller.unmarshal(xmlURL.toExternalForm(), resolver);
+ // This is EntityResolver that SAX parser (xerces) will use to resolve XSD location for the XML being parsed
+ // Here we map schema location specified in the XSD file to the local schema location,
+ // which is a path relative to the resources directory visible in the classpath.
+ JBossEntityResolver xmlResolver = new JBossEntityResolver();
+ xmlResolver.registerLocalEntity("http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd", "schema/blueprint.xsd");
+ unmarshaller.setEntityResolver(xmlResolver);
+
+ // This is to resolve namespace to class mapping and build the SchemaBinding from the class
+ DefaultSchemaResolver schemaBindingResolver = new DefaultSchemaResolver();
+ schemaBindingResolver.addClassBinding(BlueprintContext.XMLNS_BLUEPRINT, TBlueprint.class);
+
+ TBlueprint tBlueprint = (TBlueprint)unmarshaller.unmarshal(xmlURL.toExternalForm(), schemaBindingResolver);
return tBlueprint;
}
@@ -83,28 +89,4 @@
Thread.currentThread().setContextClassLoader(ctxLoader);
}
}
-
- static class BlueprintSchemaResolver extends DefaultSchemaResolver
- {
- private LogService log;
-
- public BlueprintSchemaResolver(BlueprintContext context)
- {
- this.log = context.getLog();
-
- try
- {
- addSchemaLocation(XMLNS_BLUEPRINT, "blueprint.xsd");
- addClassBinding(BlueprintContext.XMLNS_BLUEPRINT, TBlueprint.class);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot create schema resolver", ex);
- }
- }
- }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TAvailability.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TAvailability.java 2009-07-03 07:40:51 UTC (rev 90805)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TAvailability.java 2009-07-03 08:27:52 UTC (rev 90806)
@@ -31,8 +31,10 @@
*/
public enum TAvailability
{
- MANDATORY("mandatory"),
- OPTIONAL("optional");
+ // [JBXB-209] Enum parsing requires value equal to type name
+ // https://jira.jboss.org/jira/browse/JBXB-209
+ mandatory("mandatory"),
+ optional("optional");
private final String value;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBlueprint.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBlueprint.java 2009-07-03 07:40:51 UTC (rev 90805)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBlueprint.java 2009-07-03 08:27:52 UTC (rev 90806)
@@ -59,7 +59,7 @@
*/
@JBossXmlSchema(namespace = BlueprintContext.XMLNS_BLUEPRINT, elementFormDefault = XmlNsForm.QUALIFIED)
@XmlRootElement(name = "blueprint", namespace = BlueprintContext.XMLNS_BLUEPRINT)
-@XmlType(name = "Tblueprint", namespace = BlueprintContext.XMLNS_BLUEPRINT)
+@XmlType(name = "Tblueprint", namespace = BlueprintContext.XMLNS_BLUEPRINT, propOrder = { "description", "typeConverters" })
public class TBlueprint
{
protected String description;
@@ -146,7 +146,7 @@
return compMetadata;
}
- @XmlAttribute(name = "default-lazy-init")
+ @XmlAttribute(name = "default-lazy-init", namespace = BlueprintContext.XMLNS_BLUEPRINT)
public Boolean isDefaultLazyInit()
{
return defaultLazyInit;
@@ -157,6 +157,7 @@
this.defaultLazyInit = value;
}
+ @XmlAttribute
public String getDefaultInitMethod()
{
return defaultInitMethod;
@@ -167,6 +168,7 @@
this.defaultInitMethod = value;
}
+ @XmlAttribute
public String getDefaultDestroyMethod()
{
return defaultDestroyMethod;
@@ -177,6 +179,7 @@
this.defaultDestroyMethod = value;
}
+ @XmlAttribute
public BigInteger getDefaultTimeout()
{
if (defaultTimeout == null)
@@ -190,10 +193,11 @@
this.defaultTimeout = value;
}
+ @XmlAttribute
public TAvailability getDefaultAvailability()
{
if (defaultAvailability == null)
- defaultAvailability = TAvailability.MANDATORY;
+ defaultAvailability = TAvailability.mandatory;
return defaultAvailability;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServiceReference.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServiceReference.java 2009-07-03 07:40:51 UTC (rev 90805)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServiceReference.java 2009-07-03 08:27:52 UTC (rev 90806)
@@ -194,7 +194,7 @@
public TAvailability getAvailability()
{
if (availability == null)
- availability = TAvailability.OPTIONAL;
+ availability = TAvailability.optional;
return availability;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TTypeConverters.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TTypeConverters.java 2009-07-03 07:40:51 UTC (rev 90805)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TTypeConverters.java 2009-07-03 08:27:52 UTC (rev 90806)
@@ -26,7 +26,11 @@
import java.util.ArrayList;
import java.util.List;
+import javax.xml.bind.annotation.XmlType;
+import org.jboss.osgi.blueprint.BlueprintContext;
+
+
/**
*
*
@@ -55,6 +59,7 @@
*
*
*/
+@XmlType(name = "Ttype-converters", namespace = BlueprintContext.XMLNS_BLUEPRINT)
public class TTypeConverters
{
protected List<Object> components;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-07-03 07:40:51 UTC (rev 90805)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-07-03 08:27:52 UTC (rev 90806)
@@ -53,7 +53,7 @@
{
int availability = AVAILABILITY_OPTIONAL;
- if (tService.getAvailability() == TAvailability.MANDATORY)
+ if (tService.getAvailability() == TAvailability.mandatory)
availability = AVAILABILITY_MANDATORY;
return availability;
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-07-03 07:40:51 UTC (rev 90805)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-07-03 08:27:52 UTC (rev 90806)
@@ -65,7 +65,7 @@
public void testRootAttributes() throws Exception
{
TAvailability defaultAvailability = blueprint.getDefaultAvailability();
- assertEquals(TAvailability.MANDATORY, defaultAvailability);
+ assertEquals(TAvailability.mandatory, defaultAvailability);
String defaultDestroyMethod = blueprint.getDefaultDestroyMethod();
assertEquals("defaultDestroyMethod", defaultDestroyMethod);
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java 2009-07-03 07:40:51 UTC (rev 90805)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java 2009-07-03 08:27:52 UTC (rev 90806)
@@ -51,7 +51,7 @@
TBlueprint blueprint = new BlueprintParser(new MockBlueprintContext()).parse(xmlURL);
// assert default attributes
- assertEquals("default-availability: mandatory", TAvailability.MANDATORY, blueprint.getDefaultAvailability());
+ assertEquals("default-availability: mandatory", TAvailability.mandatory, blueprint.getDefaultAvailability());
assertEquals("default-timeout: 300000", new BigInteger("300000"), blueprint.getDefaultTimeout());
assertEquals("default-lazy-init: FALSE", Boolean.FALSE, blueprint.isDefaultLazyInit());
assertNull("default-init-method: null", blueprint.getDefaultInitMethod());
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/log4j.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/log4j.xml 2009-07-03 07:40:51 UTC (rev 90805)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/log4j.xml 2009-07-03 08:27:52 UTC (rev 90806)
@@ -38,11 +38,11 @@
</category>
-->
- <!-- Show jboss deployer traces
+ <!-- Show jboss deployer traces -->
<category name="org.jboss.xb">
<priority value="TRACE" />
</category>
- -->
+
<!-- ======================= -->
<!-- Setup the Root category -->
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-root.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-root.xml 2009-07-03 07:40:51 UTC (rev 90805)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-root.xml 2009-07-03 08:27:52 UTC (rev 90806)
@@ -1,5 +1,5 @@
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd schema/blueprint.xsd">
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<description>some text</description>
16 years, 6 months