Hi Dan,

Hmm, that's a pity. I was actually looking for a real composite :-)

At least for reading properties. That way I could overload isis.properties with another properties file from an external (outside war) config directory.

I'll create the composite myself.

When is the ResourceStreamSource.writeResource() used? For my composite I intend to not implement it (return null).

Regards,

Minto


Quoting Dan Haywood <d...@haywood-associates.co.uk>:

Minto,
you are right... it's implementing a ChainOfResponsibility pattern.
I'll rename it.
Dan



On 3 September 2012 18:21, Minto van der Sluis <mi...@xup.nl> wrote:

Hi folks,

While trying to figure out how the ISIS configuration/property file
reading works I added some log statements to PropertiesReader. This
resulted in the following log snippet related to property file reading.

<snip>
16:34:17,073  [PropertiesReader     main       DEBUG]  Reading
properties from 'isis.properties' using : [servlet context ('/WEB-INF'),
context loader classpath, file system (directory '../../conf')]
16:34:17,082  [PropertiesReader     main       DEBUG]  Reading
properties from 'viewer_html.properties' using : [servlet context
('/WEB-INF'), context loader classpath, file system (directory
'../../conf')]
16:34:17,084  [PropertiesReader     main       DEBUG]  Reading
properties from 'isis.properties' using : [servlet context ('/WEB-INF'),
context loader classpath, file system (directory '../../conf')]
16:34:17,089  [PropertiesReader     main       DEBUG]  Reading
properties from 'viewer_html.properties' using : [servlet context
('/WEB-INF'), context loader classpath, file system (directory
'../../conf')]
16:34:17,092  [PropertiesReader     main       DEBUG]  Reading
properties from 'isis.properties' using : [servlet context ('/WEB-INF'),
context loader classpath, file system (directory '../../conf')]
16:34:17,096  [PropertiesReader     main       DEBUG]  Reading
properties from 'viewer_html.properties' using : [servlet context
('/WEB-INF'), context loader classpath, file system (directory
'../../conf')]
16:34:17,099  [PropertiesReader     main       DEBUG]  Reading
properties from 'isis.properties' using : [servlet context ('/WEB-INF'),
context loader classpath, file system (directory '../../conf')]
16:34:17,102  [PropertiesReader     main       DEBUG]  Reading
properties from 'viewer_html.properties' using : [servlet context
('/WEB-INF'), context loader classpath, file system (directory
'../../conf')]
16:34:17,106  [IsisSystemFixturesHookAbstract main       INFO ]
initialising Isis System
16:34:17,106  [IsisSystemFixturesHookAbstract main       INFO ]  working
directory:

C:\Dev\src\Werk\Ictu\Digimelding2.0\github\prime\src\tagstore\tagstore-webapp\.
16:34:17,106  [PropertiesReader     main       DEBUG]  Reading
properties from 'isis.properties' using : [servlet context ('/WEB-INF'),
context loader classpath, file system (directory '../../conf')]
16:34:17,110  [PropertiesReader     main       DEBUG]  Reading
properties from 'viewer_html.properties' using : [servlet context
('/WEB-INF'), context loader classpath, file system (directory
'../../conf')]
16:34:17,117  [IsisSystemFixturesHookAbstract main       INFO ]
resource stream source: [servlet context ('/WEB-INF'), context loader
classpath, file system (directory '../../conf')]
16:34:17,124  [PropertiesReader     main       DEBUG]  Reading
properties from 'isis.properties' using : [servlet context ('/WEB-INF'),
context loader classpath, file system (directory '../../conf')]
16:34:17,127  [PropertiesReader     main       DEBUG]  Reading
properties from 'viewer_html.properties' using : [servlet context
('/WEB-INF'), context loader classpath, file system (directory
'../../conf')]
16:34:17,155  [TemplateImageLoaderAwt main       INFO ]  images to be
loaded from images/
16:34:17,160  [PropertiesReader     main       DEBUG]  Reading
properties from 'isis.properties' using : [servlet context ('/WEB-INF'),
context loader classpath, file system (directory '../../conf')]
16:34:17,164  [PropertiesReader     main       DEBUG]  Reading
properties from 'viewer_html.properties' using : [servlet context
('/WEB-INF'), context loader classpath, file system (directory
'../../conf')]
16:34:17,205  [PropertiesReader     main       DEBUG]  Reading
properties from 'isis.properties' using : [servlet context ('/WEB-INF'),
context loader classpath, file system (directory '../../conf')]
16:34:17,210  [PropertiesReader     main       DEBUG]  Reading
properties from 'viewer_html.properties' using : [servlet context
('/WEB-INF'), context loader classpath, file system (directory
'../../conf')]
16:34:17,218  [PropertiesReader     main       DEBUG]  Reading
properties from 'isis.properties' using : [servlet context ('/WEB-INF'),
context loader classpath, file system (directory '../../conf')]
16:34:17,222  [PropertiesReader     main       DEBUG]  Reading
properties from 'viewer_html.properties' using : [servlet context
('/WEB-INF'), context loader classpath, file system (directory
'../../conf')]
16:34:17,335  [ServicesInstallerFromConfiguration main       INFO ]
installing

org.apache.isis.runtimes.dflt.runtime.services.ServicesInstallerFromConfiguration
16:34:17,335  [PropertiesReader     main       DEBUG]  Reading
properties from 'isis.properties' using : [servlet context ('/WEB-INF'),
context loader classpath, file system (directory '../../conf')]
16:34:17,339  [PropertiesReader     main       DEBUG]  Reading
properties from 'viewer_html.properties' using : [servlet context
('/WEB-INF'), context loader classpath, file system (directory
'../../conf')]
<snap>

Initially I was puzzled by the ResourceStreamSource being used. But them
I discoverd ResourceStreamSourceCompsite. While looking at the
implementation I discovered that IMHO it is not a Composite at all. The
following snippet comes from this class:

        for (final ResourceStreamSource rss : resourceStreamSources) {
            final InputStream resourceStream =
rss.readResource(resourcePath);
            if (resourceStream != null) {
                return resourceStream;
            }
        }

In it the composite bails out after the first stream that is
successfully read. Shouldn't a composite compose a stream of all
ResourceStreamSource's contained inside the composite?

(Me wonders how a write should work in that case)

Regards,

Minto
--
ir. ing. Minto van der Sluis
Software innovator / renovator




Reply via email to