Changeset 13394


Ignore:
Timestamp:
07/11/11 13:57:21 (10 years ago)
Author:
Mark Evenson
Message:

Ensure that ASDF jar-file always loaded when encountered.

JSS:NEW is no longer deprecated.

Documentation improvements.

Update to version jss-2.1.0.

Location:
trunk/abcl/contrib/jss
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/contrib/jss/README.markdown

    r13363 r13394  
    3030class. In your call to new, as long as the symbol can refer to only
    3131one class, we use that class. In this case, it is
    32 java.io.StringWriter. You could also have written (new
    33 'io.stringwriter), (new '|io.StringWriter|), (new
    34 'java.io.StringWriter)...
     32java.io.StringWriter. You could also have written
    3533
    36 the call (#"write" sw "Hello "), uses the code in invoke.java to
    37 call the method named "write" with the arguments sw and "Hello ".
    38 JSS figures out the right java method to call, and calls it.
     34     (new 'io.stringwriter)
     35
     36or     
     37     (new '|io.StringWriter|)
     38
     39or     
     40     (new 'java.io.StringWriter)
     41
     42The call
     43
     44     (#"write" sw "Hello ")
     45     
     46uses the code in invoke.java to call the method named "write" with
     47the arguments sw and "Hello ".  JSS figures out the right java method
     48to call, and calls it.
     49
     50Static calls are possible as well with the #" macro, but the
     51first argument MUST BE A SYMBOL to distinguish
     52
     53     (#"getProperties" "java.lang.System")
     54     
     55from
     56
     57     (#"getProperties" 'java.lang.System)     
     58     
     59The first attempts to call a method on the java.lang.String object
     60with the contents "java.lang.System", which results in an error, while
     61the second invokes the static java.lang.System.getProperties() method.     
    3962
    4063If you want to do a raw java call, use #0"toString". Raw calls
     
    4265object to Lisp object conversions that ABCL does.
    4366
    44 (with-constant-signature ((name jname raw?)*) &body body)
     67
     68    (with-constant-signature ((name jname raw?)*) &body body)
     69   
    4570binds a macro which expands to a jcall, promising that the same method
    4671will be called every time. Use this if you are making a lot of calls and
    4772want to avoid the overhead of a the dynamic dispatch.
    48 e.g. (with-constant-signature ((tostring "toString"))
     73e.g.
     74 
     75    (with-constant-signature ((tostring "toString"))
    4976        (time (dotimes (i 10000) (tostring "foo"))))
    50 runs about 3x faster than (time (dotimes (i 10000) (#"toString" "foo")))
    5177
    52 (with-constant-signature ((tostring "toString" t)) ...) will cause the
    53 toString to be a raw java call. see get-all-jar-classnames below for
    54 an example.
     78runs about three times faster than
     79 
     80    (time (dotimes (i 10000) (#"toString" "foo")))
     81
     82
     83    (with-constant-signature ((tostring "toString" t)) ...)
     84   
     85will cause the toString to be a raw java call. See
     86JSS::GET-ALL-JAR-CLASSNAMES for an example.
    5587 
    5688Implementation is that the first time the function is called, the
     
    6294
    6395(jcmn class-name) lists the names of all methods for the class
     96
     97
     98Compatibility
     99-------------
     100
     101The function ENSURE-COMPATIBILITY attempts to provide a compatibility
     102mode to existing users of JSS by importing the necessary symbols into
     103CL-USER.
     104
     105Some notes on other compatibilty issues:
     106
     107*classpath-manager*
     108
     109   Since we are no longer using Beanshell, this is no longer present.
     110   For obtaining the current classloader use JAVA:*CLASSLOADER*.
     111   
  • trunk/abcl/contrib/jss/asdf-jar.lisp

    r13281 r13394  
    2525(defmethod perform ((operation load-op) (c jar-file))
    2626  (or jss:*inhibit-add-to-classpath*
    27       (jss::add-to-classpath (component-pathname c))))
     27      (jss:add-to-classpath (component-pathname c))))
    2828
    2929(defmethod operation-done-p ((operation load-op) (c jar-file))
    30   t
    31 #+nil
    3230  (or jss:*inhibit-add-to-classpath*
    3331      (member (namestring (truename (component-pathname c))) jss:*added-to-classpath* :test 'equal)))
  • trunk/abcl/contrib/jss/jss.asd

    r13360 r13394  
    44(defsystem :jss
    55  :author "Alan Ruttenberg, Mark Evenson"
    6   :version "2.0.1"
     6  :version "2.1.0"
    77  :components
    88  ((:module base :pathname "" :serial t
  • trunk/abcl/contrib/jss/packages.lisp

    r13363 r13394  
    1717   #:jcmn
    1818   #:japropos
     19   #:new
    1920
    2021;;; Useful utilities to convert common Java items to Lisp counterparts
     
    2627
    2728;;; deprecated
    28    #:new ; use JAVA:NEW
     29
    2930   #:get-java-field ; use JAVA:JFIELD
    3031
Note: See TracChangeset for help on using the changeset viewer.