incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r589729 - in /incubator/sling/trunk: assembly/src/main/java/org/apache/sling/assembly/internal/ event/src/main/java/org/apache/sling/event/ event/src/main/java/org/apache/sling/event/impl/ jackrabbit-api/src/main/java/org/apache/sling/jcr/ ...
Date Mon, 29 Oct 2007 16:41:59 GMT
Author: cziegeler
Date: Mon Oct 29 09:41:58 2007
New Revision: 589729

URL: http://svn.apache.org/viewvc?rev=589729&view=rev
Log:
javadoc fixes and use of generics.

Modified:
    incubator/sling/trunk/assembly/src/main/java/org/apache/sling/assembly/internal/Assembly.java
    incubator/sling/trunk/event/src/main/java/org/apache/sling/event/EventUtil.java
    incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
    incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/TimedEventHandler.java
    incubator/sling/trunk/jackrabbit-api/src/main/java/org/apache/sling/jcr/AbstractSlingRepository.java
    incubator/sling/trunk/jackrabbit-api/src/main/java/org/apache/sling/jcr/SlingRepository.java
    incubator/sling/trunk/jackrabbit-api/src/main/java/org/apache/sling/jcr/internal/SessionPool.java
    incubator/sling/trunk/jackrabbit-client/src/main/java/org/apache/sling/jcr/client/Activator.java

Modified: incubator/sling/trunk/assembly/src/main/java/org/apache/sling/assembly/internal/Assembly.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/assembly/src/main/java/org/apache/sling/assembly/internal/Assembly.java?rev=589729&r1=589728&r2=589729&view=diff
==============================================================================
--- incubator/sling/trunk/assembly/src/main/java/org/apache/sling/assembly/internal/Assembly.java
(original)
+++ incubator/sling/trunk/assembly/src/main/java/org/apache/sling/assembly/internal/Assembly.java
Mon Oct 29 09:41:58 2007
@@ -153,7 +153,7 @@
      * the {@link BundleSpec#getCommonLocation() common location} of the
      * respective bundle specification.
      */
-    private Map bundles;
+    private Map<String, InstalledBundle> bundles;
 
     /**
      * The current state of this instance. This is one of the
@@ -341,7 +341,7 @@
                 this.bundleSpecs = new BundleSpec[0];
             } else {
                 spec = spec.trim();
-                List specs = new ArrayList();
+                List<BundleSpec> specs = new ArrayList<BundleSpec>();
                 boolean quoted = false;
                 int start = 0;
                 for (int i = 0; i < spec.length(); i++) {
@@ -367,7 +367,7 @@
                 if (start < spec.length()) {
                     specs.add(new BundleSpec(spec.substring(start)));
                 }
-                this.bundleSpecs = (BundleSpec[]) specs.toArray(new BundleSpec[specs.size()]);
+                this.bundleSpecs = specs.toArray(new BundleSpec[specs.size()]);
             }
         }
 
@@ -394,9 +394,9 @@
             return;
         }
 
-        Map resources = new HashMap();
+        Map<String, BundleSpec> resources = new HashMap<String, BundleSpec>();
 
-        Map bundles = this.getBundles();
+        Map<String, InstalledBundle> bundles = this.getBundles();
         BundleSpec[] bundleSpecs = this.getBundleSpecs();
         for (int i = 0; i < bundleSpecs.length; i++) {
             String loc = bundleSpecs[i].getCommonLocation();
@@ -444,8 +444,8 @@
 
             this.addTemporaryRepositories(installer);
 
-            for (Iterator ei = resources.values().iterator(); ei.hasNext();) {
-                BundleSpec bundleSpec = (BundleSpec) ei.next();
+            for (Iterator<BundleSpec> ei = resources.values().iterator(); ei.hasNext();)
{
+                BundleSpec bundleSpec = ei.next();
                 bundleSpec.install(this.bundle, installer);
             }
 
@@ -462,7 +462,7 @@
             // loop through the bundles to find the ones, we have to start as
             // they are indirect dependencies
             for (int i=0; installedBundles != null && i < installedBundles.length;
i++) {
-                BundleSpec bs = (BundleSpec) resources.get(installedBundles[i].getSymbolicName());
+                BundleSpec bs = resources.get(installedBundles[i].getSymbolicName());
                 if (bs != null) {
                     // declared bundle, register internally
                     InstalledBundle ib = new InstalledBundle(bs, installedBundles[i], this);
@@ -495,8 +495,8 @@
         this.ensureInstalledBundles();
 
         // now make sure the bundles are marked started
-        for (Iterator ii = this.getBundles().values().iterator(); ii.hasNext();) {
-            InstalledBundle ib = (InstalledBundle) ii.next();
+        for (Iterator<InstalledBundle> ii = this.getBundles().values().iterator();
ii.hasNext();) {
+            InstalledBundle ib = ii.next();
             if (ib.getBundleSpec().isLinked()) {
                 Bundle bundle = ib.getBundle();
 
@@ -532,8 +532,8 @@
         }
 
         // now make sure the bundles are marked started
-        for (Iterator ii = this.getBundles().values().iterator(); ii.hasNext();) {
-            InstalledBundle ib = (InstalledBundle) ii.next();
+        for (Iterator<InstalledBundle> ii = this.getBundles().values().iterator();
ii.hasNext();) {
+            InstalledBundle ib = ii.next();
             if (ib.getBundleSpec().isLinked()) {
                 Bundle bundle = ib.getBundle();
 
@@ -566,8 +566,8 @@
         }
 
         // directly uninstall, not needed to go by stopped/unresolved
-        for (Iterator bi = this.getBundles().values().iterator(); bi.hasNext();) {
-            InstalledBundle ib = (InstalledBundle) bi.next();
+        for (Iterator<InstalledBundle> bi = this.getBundles().values().iterator();
bi.hasNext();) {
+            InstalledBundle ib = bi.next();
 
             ib.removeReferent(this);
             bi.remove();
@@ -615,22 +615,12 @@
         }
     }
 
-    private Map getBundles() {
+    private Map<String, InstalledBundle> getBundles() {
         if (this.bundles == null) {
-            this.bundles = new HashMap();
+            this.bundles = new HashMap<String, InstalledBundle>();
         }
 
         return this.bundles;
-    }
-
-    private Bundle[] getInstalledBundles() {
-        Map bundles = this.getBundles();
-        Bundle[] installedBundles = new Bundle[bundles.size()];
-        int i = 0;
-        for (Iterator bi = bundles.values().iterator(); bi.hasNext();) {
-            installedBundles[i++] = ((InstalledBundle) bi.next()).getBundle();
-        }
-        return installedBundles;
     }
 
     private Bundle findBundle(String loc) {

Modified: incubator/sling/trunk/event/src/main/java/org/apache/sling/event/EventUtil.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/event/src/main/java/org/apache/sling/event/EventUtil.java?rev=589729&r1=589728&r2=589729&view=diff
==============================================================================
--- incubator/sling/trunk/event/src/main/java/org/apache/sling/event/EventUtil.java (original)
+++ incubator/sling/trunk/event/src/main/java/org/apache/sling/event/EventUtil.java Mon Oct
29 09:41:58 2007
@@ -94,7 +94,7 @@
     /**
      * Should this event be distributed in the cluster?
      * @param event
-     * @return
+     * @return <code>true</code> if the event should be distributed.
      */
     public static boolean shouldDistribute(Event event) {
         return event.getProperty(PROPERTY_DISTRIBUTE) != null;
@@ -103,7 +103,7 @@
     /**
      * Is this a local event?
      * @param event
-     * @return
+     * @return <code>true</code> if this is a local event
      */
     public static boolean isLocal(Event event) {
         return getApplicationId(event) == null;

Modified: incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java?rev=589729&r1=589728&r2=589729&view=diff
==============================================================================
--- incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
(original)
+++ incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/JobEventHandler.java
Mon Oct 29 09:41:58 2007
@@ -525,7 +525,7 @@
     }
 
     /**
-     * @see org.apache.sling.core.event.EventUtil.JobStatusNotifier#finishedJob(org.osgi.service.event.Event,
String, String, boolean)
+     * @see org.apache.sling.event.EventUtil.JobStatusNotifier#finishedJob(org.osgi.service.event.Event,
String, String, boolean)
      */
     public void finishedJob(Event job, String eventNodePath, String lockToken, boolean reschedule)
{
         final boolean parallelProcessing = job.getProperty(EventUtil.PROPERTY_JOB_PARALLEL)
!= null;
@@ -633,14 +633,14 @@
     }
 
     /**
-     * @see org.apache.sling.core.event.JobStatusProvider#getCurrentJobs(java.lang.String)
+     * @see org.apache.sling.event.JobStatusProvider#getCurrentJobs(java.lang.String)
      */
     public Collection<Event> getCurrentJobs(String topic) {
         return this.queryCurrentJobs(topic, true);
     }
 
     /**
-     * @see org.apache.sling.core.event.JobStatusProvider#scheduledJobs(java.lang.String)
+     * @see org.apache.sling.event.JobStatusProvider#scheduledJobs(java.lang.String)
      */
     public Collection<Event> scheduledJobs(String topic) {
         return this.queryCurrentJobs(topic, false);

Modified: incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/TimedEventHandler.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/TimedEventHandler.java?rev=589729&r1=589728&r2=589729&view=diff
==============================================================================
--- incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/TimedEventHandler.java
(original)
+++ incubator/sling/trunk/event/src/main/java/org/apache/sling/event/impl/TimedEventHandler.java
Mon Oct 29 09:41:58 2007
@@ -189,11 +189,10 @@
                         if ( foundNode == null ) {
                             final Node eventNode = writeEvent(event);
                             return eventNode.lock(false, true);
-                        } else {
-                            // node is already in repository, this is an error as we don't
support updates
-                            // of timed events!
-                            logger.error("Timed event is already scheduled: " + event.getProperty(EventUtil.PROPERTY_TIMED_EVENT_TOPIC)
+ " (" + scheduleInfo.getJobId() + ")");
                         }
+                        // node is already in repository, this is an error as we don't support
updates
+                        // of timed events!
+                        logger.error("Timed event is already scheduled: " + event.getProperty(EventUtil.PROPERTY_TIMED_EVENT_TOPIC)
+ " (" + scheduleInfo.getJobId() + ")");
                     }
                     return null;
                 }
@@ -342,7 +341,7 @@
      */
     public void execute(JobContext context) {
         final String topic = (String) context.getConfiguration().get("topic");
-        final Dictionary properties = (Dictionary) context.getConfiguration().get("config");
+        final Dictionary<Object, Object> properties = (Dictionary<Object, Object>)
context.getConfiguration().get("config");
         if ( this.eventAdmin != null ) {
             try {
                 this.eventAdmin.postEvent(new Event(topic, properties));

Modified: incubator/sling/trunk/jackrabbit-api/src/main/java/org/apache/sling/jcr/AbstractSlingRepository.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jackrabbit-api/src/main/java/org/apache/sling/jcr/AbstractSlingRepository.java?rev=589729&r1=589728&r2=589729&view=diff
==============================================================================
--- incubator/sling/trunk/jackrabbit-api/src/main/java/org/apache/sling/jcr/AbstractSlingRepository.java
(original)
+++ incubator/sling/trunk/jackrabbit-api/src/main/java/org/apache/sling/jcr/AbstractSlingRepository.java
Mon Oct 29 09:41:58 2007
@@ -142,7 +142,7 @@
     }
 
     /**
-     * @see org.apache.sling.core.jcr.SlingRepository#getDefaultWorkspace()
+     * @see org.apache.sling.jcr.SlingRepository#getDefaultWorkspace()
      */
     public String getDefaultWorkspace() {
         return this.defaultWorkspace;
@@ -150,7 +150,7 @@
 
     /**
      * Logs in as an anonymous user. This implementation simply returns the
-     * result of calling {@link #login}
+     * result of calling {@link #login(Credentials, String)}
      */
     public Session login() throws LoginException, RepositoryException {
         return this.login(null, null);

Modified: incubator/sling/trunk/jackrabbit-api/src/main/java/org/apache/sling/jcr/SlingRepository.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jackrabbit-api/src/main/java/org/apache/sling/jcr/SlingRepository.java?rev=589729&r1=589728&r2=589729&view=diff
==============================================================================
--- incubator/sling/trunk/jackrabbit-api/src/main/java/org/apache/sling/jcr/SlingRepository.java
(original)
+++ incubator/sling/trunk/jackrabbit-api/src/main/java/org/apache/sling/jcr/SlingRepository.java
Mon Oct 29 09:41:58 2007
@@ -51,8 +51,8 @@
      * be used to handle client requests of whatever kinds. To handle client
      * requests, either an anonymous session retrieved by
      * {@link #loginAnonymous()} or a regular authenticated session retrieved
-     * through {@link #login(Credentials, String)} or
-     * {@link #impersonate(Session, String)} must be used.</i></b>
+     * through {@link #login(javax.jcr.Credentials, String)} or
+     * {@link Session#impersonate(javax.jcr.Credentials)} must be used.</i></b>
      *
      * @param workspace The name of the workspace to which to get an
      *            administrative session. If <code>null</code> the

Modified: incubator/sling/trunk/jackrabbit-api/src/main/java/org/apache/sling/jcr/internal/SessionPool.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jackrabbit-api/src/main/java/org/apache/sling/jcr/internal/SessionPool.java?rev=589729&r1=589728&r2=589729&view=diff
==============================================================================
--- incubator/sling/trunk/jackrabbit-api/src/main/java/org/apache/sling/jcr/internal/SessionPool.java
(original)
+++ incubator/sling/trunk/jackrabbit-api/src/main/java/org/apache/sling/jcr/internal/SessionPool.java
Mon Oct 29 09:41:58 2007
@@ -434,7 +434,6 @@
      * @param maxActiveWait The number of seconds to wait. This method has no
      *          effect if this value is less than or equal to zero.
      *
-     * @see
      */
     public void setMaxActiveSessionsWait(int maxActiveWait) {
         if (maxActiveWait > 0) {

Modified: incubator/sling/trunk/jackrabbit-client/src/main/java/org/apache/sling/jcr/client/Activator.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jackrabbit-client/src/main/java/org/apache/sling/jcr/client/Activator.java?rev=589729&r1=589728&r2=589729&view=diff
==============================================================================
--- incubator/sling/trunk/jackrabbit-client/src/main/java/org/apache/sling/jcr/client/Activator.java
(original)
+++ incubator/sling/trunk/jackrabbit-client/src/main/java/org/apache/sling/jcr/client/Activator.java
Mon Oct 29 09:41:58 2007
@@ -88,7 +88,7 @@
             }
 
             // we have no configuration, create from default settings
-            Hashtable props = new Hashtable();
+            Hashtable<String, Object> props = new Hashtable<String, Object>();
             props.put(SLING_CONTEXT, slingContext);
             props.put(SlingClientRepository.REPOSITORY_NAME, "crx");
             props.put(Context.PROVIDER_URL, "http://jcr.day.com");



Mime
View raw message