Various utility functions.
Returns the internal name for the app as Immutant sees it
(app-relative & path)
Returns an absolute file relative to app-root
Returns a file pointing to the root dir of the application
(app-uri & [host])
Returns the base URI for the app, given a host [localhost]
Registers a function to be called when the application is undeployed.
Used internally to shutdown various services, but can be used by
application code as well.
(backoff start end & body)
A simple backoff strategy that retries body in the event of error.
The first retry occurs after sleeping start milliseconds, the next
after start*2 ms, and so on, until the sleep time exceeds end ms,
at which point the caught error is tossed.
Returns the effective classpath for the app
Returns the HTTP context path for the deployed app
Returns true if the app is running in dev mode.
Returns the port that HornetQ is listening on for remote connections
Returns the HTTP port for the embedded web server
Returns true if running inside an Immutant container
Looks up the ip address from the proper service for the given name.
Looks up the ip address for the AS management interface.
(maybe-deref v & args)
derefs v if it is derefable, otherwise returns v
Returns the (possibly offset) port from the socket-binding in standalone.xml
Returns true if the leiningen profile is active
Looks up the ip address for the AS public interface.
Requires and resolves the given namespace-qualified symbol.
(set-bean-property bean prop value)
Calls a java bean-style setter (.setFooBar) for the given property (:foo-bar) and value.
Tries to import the given symbol, returning the class on success.
Tries to require and resolve the given namespace-qualified symbol, returning nil if not found.
(try-resolve-any & syms)
Tries to resolve the given namespace-qualified symbols. Returns the
first successfully resolved symbol, or nil if none of the given symbols
Looks up the ip address for the AS unsecure interface.
(wait-for t f)
(wait-for t f attempts)
Waits for (t) to be true before invoking f, if passed. Evaluates
test every 100 ms attempts times before giving up. Attempts
defaults to 300. Passing :forever for attempts will loop until the
end of time or (t) is true, whichever comes first.
(wait-for-start x f)
(wait-for-start x f attempts)
Waits for (.isStarted x) to be true before returning or invoking f.
(waiting-derefable t x)
Returns an IDeref/IBlockingDeref that completes the deref and returns x when
(t) is true.
(when-import sym & body)
Executes body when sym is successfully imported