Saavedra,
Thank you for the patch. I plan on using this with the Admin Portlet Application to fix PLUTO-107 (http://issues.apache.org/jira/browse/PLUTO-107).
/Craig
Hi!
We've used eclipse "create a patch" and standard diff options.
Hope it helps!
Regards, Oscar.
Index: src/org/apache/pluto/portalImpl/Servlet.java
===================================================================
RCS file:
/pry/pluto/pluto-orig/src/org/apache/pluto/portalImpl/Servlet.java,v
retrieving revision 1.1
diff -r1.1 Servlet.java
156a157,177
String theService = servletRequest.getParameter("hotService");ServiceManager.hotInit(getServletConfig(), theService);
if (theService != null) {
try {
} catch (Throwable exc) {javax.servlet.UnavailableException(
log("Initialization failed!", exc);
throw (new
"Initialization of oneor more services failed."));
ServiceManager.postHotInit(getServletConfig(), theService);} try {
} catch (Throwable expos) {expos);
log("Post initialization failed!",
throw (newjavax.servlet.UnavailableException(
"Post initialization ofone or more services failed."));
servletResponse.getOutputStream().println("Service reloaded.");}
return;157a179,180
}
Index: src/org/apache/pluto/portalImpl/services/ServiceManager.java
===================================================================
RCS file:
/pry/pluto/pluto-orig/src/org/apache/pluto/portalImpl/services/ServiceMa
nager.java,v
retrieving revision 1.1
diff -r1.1 ServiceManager.java
316a317,497
public static void hotInit (ServletConfig aConfig, StringtheService) throws Exception
{SERVICES_CONFIG_DIR, theService);
hotInit (aConfig, SERVICES_CONFIG_FILE,
} public static void hotInit(ServletConfig aConfig,aServiceConfigDir, String theService)
String aServiceConfigFile, String
Loading service:throws Exception { // avoid duplicate initialization of services
if (!cInitialized) { synchronized (ServiceManager.class) { if (!cInitialized) { cInitialized = true; } else { return; } } } else { return; }
ServletContext context = null;
if (aConfig != null) context = aConfig.getServletContext();
if (context != null)
context.log("ServiceManager: HOTHOT
props.load(context.getResourceAsStream(aServiceConfigFile));"+theService);
Properties props = new Properties();
try {
} catch (IOException exc) {File \"" + aServiceConfigFile
if (context != null)
context.log("ServiceManager:
+ "\" cannot befound or read.");
throw new Exception("ServiceManager:File \"" + aServiceConfigFile
+ "\" cannot be found orread.");
iter.hasNext();) {}
int numAll = 0; int numSuccessful = 0;
for (Iterator iter = props.names();
String serviceBaseName = (String)iter.next();
if (serviceBaseName.equals(theService)){
context.log("ServiceManager:Service "+theService+" FOUND!!");
servicenumAll++;
// ty to get hold of the base
Class serviceBase;Class.forName(serviceBaseName);
try {
serviceBase =
} catch (ClassNotFoundExceptionexc) {
context.log("ServiceManager: A service with name "if (context != null)
+ serviceBaseName + " cannot be found.");
props.getString(serviceBaseName);continue; }
String serviceImplName =
Class serviceImpl = null;Class.forName(serviceImplName);
Service service = null;
try {
serviceImpl =
service = (Service)serviceImpl.newInstance();
Properties serviceProps= new Properties();
try {null;
InputStream is =
is =context.getResourceAsStream(aServiceConfigDir
+ StringUtils.nameOf(serviceImpl)
+ ".properties");
if (is == null)context.getResourceAsStream(aServiceConfigDir
is =
+ StringUtils.nameOf(serviceBase)
+ ".properties");
serviceProps.load(is);if (is != null)
} catch (IOExceptionexc) {
// ignore -- wego without properties then
context.log(StringUtils.nameOf(serviceBase)} if (context != null)
+ " initializing...");
service.init(aConfig,serviceProps);
context.log(StringUtils.nameOf(serviceBase) + " done.");if (context != null)
} catch (ClassNotFoundExceptionexc) {
.log(if (context != null) context
"ServiceManager: A service implementation with name "
+ serviceImplName
+ " cannot be found.", exc);
continue;{
} catch (ClassCastException exc)
context.log("ServiceManager: Service implementation "if (context != null)
+ serviceImplName
+ " is not a service of the required type.",
exc);
continue;exc) {
} catch (InstantiationException
context.log("ServiceManager: Service implementation "if (context != null)
+ serviceImplName + " cannot be instantiated.",
exc);
.log(continue; } catch (Exception exc) { if (context != null) context
"ServiceManager: An unidentified error occurred",
exc);
cServicesMap.put(serviceBase, service);service = null; }
if (service != null) {
// build up list inreverse order for later destruction
cServicesList.add(0,service);
initialized ("numSuccessful++; } } }
if (context != null)
context.log("ServiceManager: Services
+ numSuccessful + "/" +numAll + " successful).");
if (numSuccessful != numAll) {Services initialized ("
throw new Exception("ServiceManager:
+ numSuccessful + "/" +numAll + " successful).");
theService) {} }
public static void postHotInit(ServletConfig aConfig, String
cServicesMap.get(Class.forName(theService));// avoid duplicate destruction of services
if (cInitialized) { synchronized (ServiceManager.class) { if (cInitialized) { cInitialized = false; } else { return; } } } else { return; }
ServletContext context = null;
if (aConfig != null) context = aConfig.getServletContext ();
// post init all services
try {
Service service = (Service)
service.postInit(aConfig);Service couldn't be started (postInit) after init..",exc);
} catch (Exception exc) {
if (context != null)
context.log("ServiceManager:
Index:}
}
src/org/apache/pluto/portalImpl/services/pageregistry/PageRegistry.java
===================================================================
RCS file:
/pry/pluto/pluto-orig/src/org/apache/pluto/portalImpl/services/pageregis
try/PageRegistry.java,v
retrieving revision 1.1
diff -r1.1 PageRegistry.java
36c36
< private final static PageRegistryService cService = ---
private static PageRegistryService cService =46a47,51
ServiceManager.getService}
public static void setRootFragment()
{
cService = (PageRegistryService)
(PageRegistryService.class);Index:
src/org/apache/pluto/portalImpl/services/pageregistry/PageRegistryServic
eFileImpl.java
===================================================================
RCS file:
/pry/pluto/pluto-orig/src/org/apache/pluto/portalImpl/services/pageregis
try/PageRegistryServiceFileImpl.java,v
retrieving revision 1.1
diff -r1.1 PageRegistryServiceFileImpl.java
66c66
< private HashMap fragments = new HashMap();
---
private static HashMap fragments = new HashMap();99a100
fragments = new HashMap();101c102,103
< ---
PageRegistry.setRootFragment();Index:
src/org/apache/pluto/portalImpl/services/portletdefinitionregistry/Portl
etDefinitionRegistry.java
===================================================================
RCS file:
/pry/pluto/pluto-orig/src/org/apache/pluto/portalImpl/services/portletde
finitionregistry/PortletDefinitionRegistry.java,v
retrieving revision 1.1
diff -r1.1 PortletDefinitionRegistry.java
37c37
< private final static PortletDefinitionRegistryService cService = ---
private static PortletDefinitionRegistryService cService =57a58,62
(PortletDefinitionRegistryService.class);}
public static void setPortletDefinitionRegistryService()
{
PortletDefinitionRegistryService cService = (PortletDefinitionRegistryService) ServiceManager.getService
Index:
src/org/apache/pluto/portalImpl/services/portletdefinitionregistry/Portl
etDefinitionRegistryServiceContextImpl.java
===================================================================
RCS file:
/pry/pluto/pluto-orig/src/org/apache/pluto/portalImpl/services/portletde
finitionregistry/PortletDefinitionRegistryServiceContextImpl.java,v
retrieving revision 1.1
diff -r1.1 PortletDefinitionRegistryServiceContextImpl.java
66,67c66,67
< private Mapping webXmlMapping;
< private Mapping portletXmlMapping;
---
private static Mapping webXmlMapping;69,70c69,70
private static Mapping portletXmlMapping;
< private PortletApplicationDefinitionListImpl registry;
< private Map definitions;
---
private static PortletApplicationDefinitionListImpl registry;103a104,109
private static Map definitions;
Index:public void postInit() throws Exception { PortletDefinitionRegistry.setPortletDefinitionRegistryService(); }
src/org/apache/pluto/portalImpl/services/portletdefinitionregistry/Portl
etDefinitionRegistryServiceFileImpl.java
===================================================================
RCS file:
/pry/pluto/pluto-orig/src/org/apache/pluto/portalImpl/services/portletde
finitionregistry/PortletDefinitionRegistryServiceFileImpl.java,v
retrieving revision 1.1
diff -r1.1 PortletDefinitionRegistryServiceFileImpl.java
165a166,170
PortletDefinitionRegistry.setPortletDefinitionRegistryService();public void postInit() throws Exception {
Index:}
src/org/apache/pluto/portalImpl/services/portletentityregistry/PortletEn
tityRegistry.java
===================================================================
RCS file:
/pry/pluto/pluto-orig/src/org/apache/pluto/portalImpl/services/portleten
tityregistry/PortletEntityRegistry.java,v
retrieving revision 1.1
diff -r1.1 PortletEntityRegistry.java
37c37
< private final static PortletEntityRegistryService cService = ---
private static PortletEntityRegistryService cService =47a48,52
}Index:
public static void setPortletEntityRegistryService()
{
cService = (PortletEntityRegistryService) ServiceManager.getService (PortletEntityRegistryService.class);
src/org/apache/pluto/portalImpl/services/portletentityregistry/PortletEn
tityRegistryServiceFileImpl.java
===================================================================
RCS file:
/pry/pluto/pluto-orig/src/org/apache/pluto/portalImpl/services/portleten
tityregistry/PortletEntityRegistryServiceFileImpl.java,v
retrieving revision 1.1
diff -r1.1 PortletEntityRegistryServiceFileImpl.java
96a97,100
public void postInit() throws Exception {
PortletEntityRegistry.setPortletEntityRegistryService();
}
******************AVISO LEGAL**********************
Este mensaje es privado y confidencial y solamente para la persona a la que va dirigido. Si usted ha recibido este mensaje por error, no debe revelar, copiar, distribuir o usarlo en ningun sentido. Le rogamos lo comunique al remitente y borre dicho mensaje y cualquier documento adjunto que pudiera contener. No hay renuncia a la confidencialidad ni a ningun privilegio por causa de transmision erronea o mal funcionamiento. Cualquier opinion expresada en este mensaje pertenece unicamente al autor remitente, y no representa necesariamente la opinion de Santander Central Hispano, a no ser que expresamente se diga y el remitente este autorizado para hacerlo. Los correos electronicos no son seguros, no garantizan la confidencialidad ni la correcta recepcion de los mismos, dado que pueden ser interceptados, manipulados, destruidos, llegar con demora, incompletos, o con virus. Santander Central Hispano no se hace responsable de las alteraciones que pudieran hacerse al mensaje una vez enviado.Este mensaje solo tiene una finalidad de informacion, y no debe interpretarse como una oferta de venta o de compra de valores ni de instrumentos financieros relacionados. En el caso de que el destinatario de este mensaje no consintiera la utilizacion del correo electronico via Internet, rogamos lo ponga en nuestro conocimiento.
**********************DISCLAIMER***************** This message is private and confidential and it is intended exclusively for the addressee. If you receive this message by mistake, you should not disseminate, distribute or copy this e-mail. Please inform the sender and delete the message and attachments from your system. No confidentiality nor any privilege regarding the information is waived or lost by any mistransmission or malfunction.Any views or opinions contained in this message are solely those of the author, and do not necessarily represent those of Santander Central Hispano, unless otherwise specifically stated and the sender is authorised to do so.E-mail transmission cannot be guaranteed to be secure, confidential, or error-free, as information could be intercepted, corrupted, lost, destroyed, arrive late, incomplete, or contain viruses. Santander Central Hispano does not accept responsibility for any changes in the contents of this message after it has been sent.This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. If the addressee of this message does not consent to the use of internet e-mail, please communicate it to us.
