<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Groovy Classpath &amp; Dynamic class loading</title>
	<atom:link href="http://voituk.kiev.ua/2008/06/04/groovy-classpath-dynamic-loading/feed/" rel="self" type="application/rss+xml" />
	<link>http://voituk.kiev.ua/2008/06/04/groovy-classpath-dynamic-loading/</link>
	<description>while ( isAlive() ) {doCode(); doFun();}</description>
	<lastBuildDate>Sun, 13 May 2012 21:35:13 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Sergey Bondarenko</title>
		<link>http://voituk.kiev.ua/2008/06/04/groovy-classpath-dynamic-loading/comment-page-1/#comment-14420</link>
		<dc:creator>Sergey Bondarenko</dc:creator>
		<pubDate>Tue, 10 Jun 2008 13:45:41 +0000</pubDate>
		<guid isPermaLink="false">http://voituk.kiev.ua/?p=489#comment-14420</guid>
		<description>Сегодня мне это пригодилось :)
Вадим, спасибо! Расскажу, в чём было дело.

На машину ставится несколько Jetty и все настроены на один и тот же (известный) порт. Один из Jetty запущен. Надо уметь узнавать какой именно.

Делаем такой Groovlet:

response.contentType = &quot;text/plain&quot;
String groovyJarPath = GroovyObject.getProtectionDomain().getCodeSource().getLocation().getFile()
String installationDir = new File(groovyJarPath).parentFile.parentFile.absolutePath
println &quot;installation.dir=$installationDir&quot;

Открываем его в браузере:
http://localhost:8081/groovy/JettyProperties.groovy

и видим:
installation.dir=D:\temp\jetty_server</description>
		<content:encoded><![CDATA[<p>Сегодня мне это пригодилось :)<br />
Вадим, спасибо! Расскажу, в чём было дело.</p>
<p>На машину ставится несколько Jetty и все настроены на один и тот же (известный) порт. Один из Jetty запущен. Надо уметь узнавать какой именно.</p>
<p>Делаем такой Groovlet:</p>
<p>response.contentType = &#8220;text/plain&#8221;<br />
String groovyJarPath = GroovyObject.getProtectionDomain().getCodeSource().getLocation().getFile()<br />
String installationDir = new File(groovyJarPath).parentFile.parentFile.absolutePath<br />
println &#8220;installation.dir=$installationDir&#8221;</p>
<p>Открываем его в браузере:<br />
<a href="http://localhost:8081/groovy/JettyProperties.groovy" rel="nofollow">http://localhost:8081/groovy/JettyProperties.groovy</a></p>
<p>и видим:<br />
installation.dir=D:\temp\jetty_server</p>
]]></content:encoded>
	</item>
</channel>
</rss>

