felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r368722 - in /incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework: BundleImpl.java BundleInfo.java Felix.java
Date Fri, 13 Jan 2006 13:55:16 GMT
Author: rickhall
Date: Fri Jan 13 05:55:13 2006
New Revision: 368722

URL: http://svn.apache.org/viewcvs?rev=368722&view=rev
Log:
Integrated changes for Bundle.getSymbolicName() and Bundle.getLastModified().

Modified:
    incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleImpl.java
    incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleInfo.java
    incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java

Modified: incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleImpl.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleImpl.java?rev=368722&r1=368721&r2=368722&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleImpl.java
(original)
+++ incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleImpl.java
Fri Jan 13 05:55:13 2006
@@ -60,6 +60,11 @@
         return m_felix.getBundleHeaders(this);
     }
 
+    public long getLastModified()
+    {
+        return m_info.getLastModified();
+    }
+
     public String getLocation()
     {
         return m_felix.getBundleLocation(this);
@@ -96,11 +101,21 @@
         return m_info.getState();
     }
 
+    public String getSymbolicName()
+    {
+    	return (String) getHeaders().get(Constants.BUNDLE_SYMBOLICNAME);
+    }
+
     public boolean hasPermission(Object obj)
     {
         return m_felix.bundleHasPermission(this, obj);
     }
 
+    public Class loadClass(String name) throws ClassNotFoundException
+    {
+        return m_felix.loadBundleClass(this, name);
+    }
+
     public void start() throws BundleException
     {
         m_felix.startBundle(this, true);
@@ -137,21 +152,11 @@
 
     public Dictionary getHeaders(String locale)
     {
-        // TODO: Implement Bundle.getHeaders()
+        // TODO: Implement Bundle.getHeaders(String locale)
+    	// Should be done after [#FELIX-27] resolution
         return null;
     }
 
-    public String getSymbolicName()
-    {
-        // TODO: Implement Bundle.getSymbolicName()
-        return null;
-    }
-
-    public Class loadClass(String name) throws ClassNotFoundException
-    {
-        return m_felix.loadBundleClass(this, name);
-    }
-
     public Enumeration getResources(String name) throws IOException
     {
         // TODO: Implement Bundle.getResources()
@@ -168,12 +173,6 @@
     {
         // TODO: Implement Bundle.getEntry()
         return null;
-    }
-
-    public long getLastModified()
-    {
-        // TODO: Implement Bundle.getLastModified()
-        return 0;
     }
 
     public Enumeration findEntries(String path, String filePattern, boolean recurse)

Modified: incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleInfo.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleInfo.java?rev=368722&r1=368721&r2=368722&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleInfo.java
(original)
+++ incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleInfo.java
Fri Jan 13 05:55:13 2006
@@ -28,6 +28,7 @@
     private BundleArchive m_archive = null;
     private Module[] m_modules = null;
     private int m_state = 0;
+    private long m_modified = 0;
     private BundleActivator m_activator = null;
     private BundleContext m_context = null;
     // Indicates that the bundle was either updated
@@ -196,6 +197,16 @@
     public void setState(int i)
     {
         m_state = i;
+    }
+
+    public long getLastModified()
+    {
+        return m_modified;
+    }
+
+    public void setLastModified(long l)
+    {
+        m_modified = l;
     }
 
     public int getPersistentState()

Modified: incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java?rev=368722&r1=368721&r2=368722&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java
(original)
+++ incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java
Fri Jan 13 05:55:13 2006
@@ -1471,6 +1471,7 @@
             }
 
             info.setState(Bundle.INSTALLED);
+            info.setLastModified(System.currentTimeMillis());
 
             // Mark as needing a refresh.
             info.setRemovalPending();
@@ -1708,6 +1709,7 @@
 
         // Set state to uninstalled.
         info.setState(Bundle.UNINSTALLED);
+        info.setLastModified(System.currentTimeMillis());
 
         // Fire bundle event.
         fireBundleEvent(BundleEvent.UNINSTALLED, bundle);
@@ -1882,6 +1884,7 @@
             {
                 // This will persistently set the bundle's start level.
                 bundle.getInfo().setStartLevel(getInitialBundleStartLevel());
+                bundle.getInfo().setLastModified(System.currentTimeMillis());
             }
 
             synchronized (m_installedBundleLock_Priority2)



Mime
View raw message