September 2010
Intermediate to advanced
766 pages
18h 35m
English
Following is a full listing of all source code used in this runnable example.
package org.jboss.ejb3.examples.ch07.rsscache.impl.rome;
import java.net.MalformedURLException;
import java.net.URL;
/**
* Package-private utilities to protect against mutable
* state getting exported
*
* @author <a href="mailto:andrew.rubinger@jboss.org">ALR</a>
*/
class ProtectExportUtil
{
//--------------------------------------------------------------------------||
// Constructor -------------------------------------------------------------||
//--------------------------------------------------------------------------||
/**
* Internal constructor; protects against instantiation
*/
private ProtectExportUtil()
{
}
//--------------------------------------------------------------------------||
// Functional Methods ------------------------------------------------------||
//--------------------------------------------------------------------------||
/**
* Returns a copy of the specified URL; used to ensure that mutable
* internal state is not leaked out to clients
* @param url
* @return
*/
static URL copyUrl(final URL url)
{
// If null, return
if (url == null)
{
return url;
}
try
{
// Copy
return new URL(url.toExternalForm());
}
catch (final MalformedURLException e)
{
throw new RuntimeException("Error in copying URL", e);
}
}
}package org.jboss.ejb3.examples.ch07.rsscache.impl.rome; import java.net.MalformedURLException; import ...