Bundle loader in FOWCore

By farcaller November 3rd, 2008

I’ve made a basic bundle loader in FOWCore, so now it’s absolutely usable.

What’s FOWCore? That’s an FOW-based application, that you can use if you don’t want to go low-level with FOW. You write handlers in bundles, and then FOWCore will dynamically load and register handling stuff.

Currently that works via config file. First you list all the bundles you use:

	<key>bundles</key>
	<array>
		<string>../test_servers/TestBundle/build/Debug/TestBundle.bundle</string>
		...
	</array>

then you configure URL mappings, by providing URL regexp, class name, bundle for class and selector:

	<key>handlers</key>
	<array>
		<dict>
			<key>url</key>
			<string>get/(.*)</string>
			<key>bundle</key>
			<string>org.hackndev.TestBundle</string>
			<key>class</key>
			<string>TestBundle</string>
			<key>selector</key>
			<string>handleGet:</string>
		</dict>
		<dict>
			<key>url</key>
			<string>post/(.*)</string>
			<key>bundle</key>
			<string>org.hackndev.TestBundle</string>
			<key>class</key>
			<string>TestBundle</string>
			<key>selector</key>
			<string>handlePost:</string>
		</dict>
	</array>

I’m considering two ways to configure a running FOWCore application: either by web interface (there would be thing like “webconf.bundle” in FOWCore) or by a configuration utility that would connect to FOWCore instance via unix socket.

This entry was posted on Monday, November 3rd, 2008 at 14:49 and is filed under fowcore. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply