srm: Break cyclic dependencies

I observed the fulling NPE during SRM startup:

> 26 Mar 2014 20:20:37 (System) [] Bug found, please report the following information to support@dcache.org
> java.lang.RuntimeException: URL [file:/root/dcache-2.9.0-SNAPSHOT/share/services/srm.batch]: line 262: java.lang.NullPointerException
>         at dmg.cells.nucleus.CellShell.execute(CellShell.java:1653) ~[cells-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
>         at dmg.cells.nucleus.CellShell.execute(CellShell.java:1563) ~[cells-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
>         at org.dcache.boot.Domain.executeBatchFile(Domain.java:270) ~[dcache-core-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
>         at org.dcache.boot.Domain.executeService(Domain.java:216) ~[dcache-core-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
>         at org.dcache.boot.Domain.start(Domain.java:129) ~[dcache-core-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
>         at org.dcache.boot.BootLoader.main(BootLoader.java:122) ~[dcache-core-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
> java.lang.NullPointerException: null
>         at diskCacheV111.srm.dcache.UnpinCompanion.unpinFile(UnpinCompanion.java:142) ~[dcache-core-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
>         at diskCacheV111.srm.dcache.Storage.unPinFile(Storage.java:1034) ~[dcache-core-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
>         at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source) ~[na:na]
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_51]
>         at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_51]
>         at org.dcache.commons.stats.MonitoringProxy.invoke(MonitoringProxy.java:47) ~[dcache-common-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
>         at com.sun.proxy.$Proxy28.unPinFile(Unknown Source) ~[na:na]
>         at org.dcache.srm.request.GetFileRequest.stateChanged(GetFileRequest.java:476) ~[srm-server-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
>         at org.dcache.srm.request.Job.setState(Job.java:344) ~[srm-server-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
>         at org.dcache.srm.request.Job.onSrmRestart(Job.java:1111) ~[srm-server-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
>         at org.dcache.srm.scheduler.SchedulerContainer.restoreJobsOnSrmStart(SchedulerContainer.java:115) ~[srm-server-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
>         at org.dcache.srm.request.sql.DatabaseJobStorageFactory.restoreJobsOnSrmStart(DatabaseJobStorageFactory.java:144) ~[srm-server-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
>         at org.dcache.srm.SRM.start(SRM.java:314) ~[srm-server-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_51]
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_51]
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_51]
>         at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_51]
>         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1681) ~[spring-beans-4.0.2.RELEASE.jar:4.0.2.RELEASE]
>         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1620) ~[spring-beans-4.0.2.RELEASE.jar:4.0.2.RELEASE]
>         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549) ~[spring-beans-4.0.2.RELEASE.jar:4.0.2.RELEASE]
>         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[spring-beans-4.0.2.RELEASE.jar:4.0.2.RELEASE]
>         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) ~[spring-beans-4.0.2.RELEASE.jar:4.0.2.RELEASE]
>         at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) ~[spring-beans-4.0.2.RELEASE.jar:4.0.2.RELEASE]
>         at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-4.0.2.RELEASE.jar:4.0.2.RELEASE]
>         at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) ~[spring-beans-4.0.2.RELEASE.jar:4.0.2.RELEASE]
>         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) ~[spring-beans-4.0.2.RELEASE.jar:4.0.2.RELEASE]

This happens due to cyclic initialization dependencies, which causes requests to
be restored before Storage is fully initialized.

The patch resolves this by breaking the initialization dependencies. This involved
moving some code out of the Storage class, which has the nice side effect of
increasing cohesion.

I deleted an older info provider webservice that wasn't used and which I guess
nobody knew about.

Target: trunk
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/6817/