The Artima Developer Community
Sponsored Link

Java Buzz Forum
A Question on Applying the LGPL to Java

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic    
Flat View: This topic has 0 replies on 1 page
Rod Waldhoff

Posts: 99
Nickname: rwald
Registered: Jun, 2003

Rod Waldhoff is.
A Question on Applying the LGPL to Java Posted: Jun 26, 2003 6:34 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Rod Waldhoff.
Original Post: A Question on Applying the LGPL to Java
Feed Title: Rod Waldhoff: Java Channel
Feed URL: http://radio-weblogs.com/0122027/categories/java/rss.xml
Feed Description: about the Java programming language
Latest Java Buzz Posts
Latest Java Buzz Posts by Rod Waldhoff
Latest Posts From Rod Waldhoff: Java Channel

Advertisement
Assume org.gnu.foo is an LPGL'ed Java package. Which of the following can I do without applying the LGPL to my code:
  1. Import and use a type from org.gnu.foo:
    import org.gnu.foo.Bar;
    class ClientCode {
      public static void main(String[] args) {
        Bar bar = new Bar();
        bar.someMethod(args[0]);
      }
      /* ... */
    }
    or
    import org.gnu.foo.Bar;
    class MoreClientCode {
      void clientMethod(Bar bar) {
        bar.someMethod("xyzzy");
      }
      /* ... */
    }
  2. Extend from a type in org.gnu.foo:
    import org.gnu.foo.Bar;
    class ClientCode extends Bar {
      /* ... */
    }
  3. Specialize a type from org.gnu.foo, but via composition rather than inheritance:
    import org.gnu.foo.Bar;
    class ProxyBar {
      ProxyBar(Bar bar) {
        this.bar = bar;
      }
     
      void someMethod(String str) {
        return bar.someMethod(str.toUpperCase());
      }
     
      /* ... */
     
      private Bar bar;
    }
  4. Invoke a method from org.gnu.foo using "hard-coded" reflection:
    class ClientCode {
      public static void main(String[] args) throws Exception {
        Class klass = Class.forName("org.gnu.foo.Bar");
        Method method = klass.getMethod("someMethod", new Class[] { String.class });
        Object obj = klass.newInstance();
        method.invoke(obj,new String[] { args[0] });
      }
    }
  5. Invoke a method from org.gnu.foo using runtime-determined reflection:
    class ClientCode {
      public static void main(String[] args) throws Exception {
        Class klass = Class.forName(args[0]);
        Method method = klass.getMethod(args[1], new Class[] { String.class });
        Object obj = klass.newInstance();
        method.invoke(obj,new String[] { args[2] });
      }
    }
    invoked via
    java ClientCode org.gnu.foo.Bar someMethod xyzzy
  6. Invoke a method from org.gnu.foo as an external process:
    class ClientCode {
      public static void main(String[] args) throws Exception {
        Process p = Runtime.getRuntime().exec("java org.gnu.foo.Bar xzyyz");
        /* ... */
      }
    }
How do these answers change if org.gnu.foo is licensed under the "regular" GPL?

Read: A Question on Applying the LGPL to Java

Topic: ctl+shift+v in IDEA Previous Topic    

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use