Way to configure system properties for EJB? - ejb

Maybe a duplicate question, however, I did not find any answer to it.
I have an MDB, I'd like to configure some system properties in descriptor files, these properties must be available during deployment.
where should I put these property name-value pair? Is there any way I can do that?

Related

Storing configuration keys in resource files with configuration modes

We are storing keys and configuration values (which do not change very frequently) in both web.config files and database too. However, its hard to maintain, lots of problems occur in this method.
I want to fix these issues. most of them are fixed, some of them are dependent upon configuration modes.
Can we store these keys in resx files and use them like globalization? I mean, like in MVC, we can use seperate views according to even custom conditions (like browser and any other things).
Using OOP knowledge, it might be (such as we can create a resource factory and serve resources according to active configuration mode). But without the effort and sacrificing design-time support, is there any other way?
Resx files are for resources like strings and images etc.
It would be cleaner if could have configuration stored in the DB only and have a Configuration Service return the configuration per environment/config mode.The web.config will just point to the right Configuration service.

Using web.config as store for referenced class library's Properties.Settings class?

Folks,
This is probably very simple, but I couldn't turn up anything explicitly on point.
I have a web app (ASP.Net 4.0) that references a class library. The class library has various settings. I'd like to use the strongly-typed Properties.Settings capability within the class library. However, since class library config files are ignored under ASP.Net, I'd like the backing store for the settings to be a section of web.config as opposed to a class library-specific app.config.
I figure this is either outrightly forbidden or is as easy as pie to do. Can anyone tell me how to make it work?
Thanks,
Ann L.
I'm not 100% sure what you're asking, but I see two possible questions:
The class library has properties that are controlled (set) by the config file, but class libraries don't consume config files. If that's the case, then all you need to do is move those settings to the calling app's config file - the class library will automatically use the calling app's Web.config (or App.config, as appropriate).
You want to create a custom Configuration Section, which can also be done: How to: Create Custom Configuration Sections Using ConfigurationSection
Unless I've totally misread your question (always a possibility with me :) ), I'd go with #1 as it's easier, unless there's something unique or required in your design to move you to option 2.

How does one create Channels at runtime using BlazeDS?

So as you may or may not know, BlazeDS (open source version of LiveCycle Data Services) is a nice way to get your server-side Java and client-side Flex application to play together. Unfortunately, it does have several pitfalls that need to be corrected. I'll try to explain one of them here.
All of BlazeDS's configuration is written via XML files in the flex/ folder of your webapp. The default names are separated for clarity, such as services-config.xml, remoting-config.xml, messaging-config.xml, etc. In these configuration files (particularly services-config.xml), Channels are defined; these setup URIs and objects used to capture and send information between the server and the client. In these config files, it is quite common to use a syntax like so:
<channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
<endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
<properties>
<add-no-cache-headers>false</add-no-cache-headers>
</properties>
</channel-definition>
Unfortunately, what they don't tell you is that some of these key-in replacements (ie: {context.root}) are not replaced dynamically upon execution but upon compilation of the WAR file you intend to distribute. Obviously not a good idea when switching domains.
So, instead I seek to dynamically define these channels. According to the documentation, that's all good and fine, but it only works if the channel already exists when the webapp is launched. I feel like that sort of defeats the point.
So my question is, how do you truly create channels dynamically so that both the client and the server recognize their existence?
Read this blog post; I believe it is what you're after.
I believe these xml config files have no direct relation to the server at all. They are used to tell the SWF how to find the server.
During Compile time of your Flex App; the services-config information is, in essence, hard coded into the SWF.

Significance of : xmlns:mx="http://www.adobe.com/2006/mxml"

I want to know a bit more about 'xmlns:mx="http://www.adobe.com/2006/mxml". Generally namespaces acts as the pointers to the component location, but I've always seen them directing resources within local directory structure. When 'xmlns:mx="http://www.adobe.com/2006/mxml"' is used than is a new connection is set with adobe server or is it just a convention?
If an actual connection is set then the application should not get compiled without internet connection but in reality we can compile and run our application without internet connection as well !! Plz correct me if I am wring somewhere.
Please help me understanding its significance,
Thanks in advance.
Ashine.
It's just an identifier that with the use of flex-config.xml file (you can find it in your $SDK_HOME/frameworks folder) points to mxml-manifest.xml file which contains definitions of classes that you can use by "importing" specific namespace.
It's just a convention. Try actually following the URI, the page doesn't exist!
Namespaces aren't the same as directory structures btw... The actionscript compiler cheats a lot to make it look that way.
The URL is known as a namespace URL. Not all namespaces are directory structures. But, it takes quite a bit more work to create a namespace URL; whereas directory namespaces are almost automatic.
To create a namespace URL, you need to use a library project and add a manifest.xml file.
The documentation is really light on this topic. But, I demo about this in the last episode of The Flex Show's screencast series on creating custom components and in an episode of the Flextras Friday Lunch.

Unity 2.0 and policy injection in .config

I want to use unity (2.0) to resolve my dependencies in a way so that i can configure policy injection (policies, matching rules and call handlers) in the .config file.
Or an other way to put it; i want my resolved objects to be "policy enabled", so that i can add and change to policies in config without have to recompile.
Any ideas on how to do that?
OK - I also posted in the Unity-communitysite on CodePlex (http://unity.codeplex.com/Thread/View.aspx?ThreadId=215690) and got an answer there.
The trick is to add the EnterpriseLibraryCoreExtension to your container when you construct it. Like this:
_container.AddNewExtension<EnterpriseLibraryCoreExtension>();
This will pick up the configuration for your appdomains (app.config or web.config).
And that will give me the behavior I want!

Resources