ClassLoader for plugins

Hi there,
I have an application where I would like to instantiate plugin classes. Now, for reasons that would be a bit too lengthy to explain right now I want each of these plugins to have their own classloader (i think, see the rest). Basically I want them not to share statics and I want to be able to see which classes are being loaded from within the plugins (so I can reject the instantiation of certain classes from within plugins, etc.).
I've tried extending URLClassLoader but even if I explicitly call a loadClass on my classloader any classes instantiated from within the class I created with my classloader use the original application class loader.
Can anyone point me in the direction? So the two features I need are :
- Each plugin needs it's own statics and such
- I need to reject instantiation of certain classes, but only if this is attempted from within plugin code
Is this possible? And if so, what's the most elegant way to accomplish it.
Any help would be much appreciated.

When you set up a URLClassloader the default behaviour is that it delegates class requests to the parent classloader (generally the system classloader) and only when the parent classloader returns "not found" does it attempt to load the class itself.
So your URLCLassLoader will not, itself, load any class which is present on the class path. You must place the plugin in a separate jar and ensure that no class with the same FQN exists on the class path. Further when a class accesses a class through a reference it asks the classloader which loaded it (not necessarily that from which it was requested) so if a class load is delegated then any referenced classes will be requested from the classloader it was delegated to.

Similar Messages

  • ClassLoading in plugin architecture

    I'm developing a Java Desktop Application with a plugin architecture. I'd like to know of any good resources for information on how to use ClassLoaders to implement different schemes of plugin isolation and sharing.
    Examples:
    Sharing Each plugin depends on the application's public API jar, and classes loaded from here must be shared between the application and all plugins.
    Isolation Plugin A may be built using version 0.2.4.1 of a third-party Xxx.jar while plugin B is built using version 1.0.0.2 of Xxx.jar, which is incompatible with the earlier version. The two plugins must be isolated from each other, so that each loads the classes from its own version of Xxx.jar.
    There are probably many other issues that my plugin mechanism needs to take care of. The application is not supposed to support hot-swapping of plugins.
    Any help and/or references will be highly appreciated.
    Edited by: nygaard on May 29, 2009 10:30 AM

    nygaard wrote:
    Here are two more things, I'd like to support:
    Plugin/application isolation Plugin A uses third-party Xxx.jar which in turn depends on version 1.2.3.4 of log4j.jar. The application itself uses version 0.1.2.3 of log4j.jar which is incompatible with 1.2.3.4.this is a little more complicated, but doable. basically, you will have to have some bootstrapping startup code for you application which only includes a few jars in the main application classloader (not including anything you want to be isolated). basically, you initial classpath should only have a bootstrap jar and any common interfaces (presumably you will have some plugin API). your bootstraping code should then load your main application in a new classloader (we'll call it the app classloader to distinguish) which has the main classloader as its parent. your plugins should be loaded with the parent classloader being the main classloader, not the app classloader.
    Plugin/plugin sharing Plugin A may depend on plugin B and should be allowed to use classes found there.this makes things a little stickier. does A just need to use classes from B, or does it need to interact with B (two different things)? the former is easy (just sharing jar files). the latter is much more difficult, and may require some custom classloading implementation. Also, you will need some sort of discovery mechanism (way for A to "lookup" B within the application).
    Edited by: jtahlborn on May 29, 2009 11:41 AM

  • I am trying to connect Garritan Personal Symphony to Logic Express and Garageband. A dialog box pops up and asks for plugin Garritan-P. Where do I find it and what do I do with it. I can't locate this plugin doing searches on any of the porgrams.

    I am trying to connect Garritan Personal Symphony to Logic Express and Garageband. A dialog box pops up and asks for plugin Garritan-P. Where do I find it and what do I do with it. I can't locate this plugin doing searches on any of the porgrams.

    I'm not sure which version of Garritan Personal Orchestra you have or when you are getting a window pop-up, but check this link for starters:
    http://afjohnston.blogspot.com/2009/11/using-garritan-personal-orchestra-gpo.htm l

  • Ps elements 5.0 freezes at "scanning for plugins"

    I have photoshop elements 5.0, and have had no problems with it for the past couple years that I've had it until now. Each time I open the program, it freezes, and it says that it is "scanning for plugins". I'm using it on windows vista. I tried uninstalling all adobe software I had on my computer and then reinstalling it on the advice of a friend, but this didn't help the situation. What should I do to get my photoshop to work again?

    michelle.gn wrote:
    In the plug-ins folder, under the subfolder of import-export there was a plug-in called Twain_32. Is that the same thing? Because when I deleted that, there was no change.
    Same thing. A little late, but you could have just disabled it by renaming it with the ~ (tilde) sign before the name instead of deleting it.
    If it was twain, I would think it would hang on building twain not scanning for plug ins. Here's a tech doc on twain anyway...
    http://kb2.adobe.com/cps/408/kb408849.html
    First, try a reset of the application preference file.
    Windows: Press and hold in as you launch, the ctrl + shift + alt keys as you launch the editor. Do not release these three keys...ctrl + shift + alt keys. A dialog box will come up saying something like "Delete Photoshop Elements settings file?" After this dialog comes up, you can release those three keys. click "OK" to accept.
    Mac: Use above instructions to reset the application except change the shortcut key combo to cmd + shift + opt.
    Check if Elements loads correctly.
    (Maybe, you pointed Elements in your preferences to an external folder with a native filter that belongs to another version of Elements or Photoshop which can cause conflict. The application reset will remove that check mark so if it works with a reset then you point the plug ins folder to another folder and you get a hang then you have a conflicting plug in in that folder.)
    If it doesn't....
    Have you moved a native plug in from another version of Photoshop or Photoshop Elements into the Photoshop Elements 5.0 plugin folder? Having another version of Element's or Photoshop's filter in Elements will create conflicts. You might also check that you haven't installed a version of Camera Raw that doesn't belong in your version of Elements. (The Camera Raw would probably give a Camera Raw error but something to check since it's stalling at plug ins.)
    Have you recently added any 3rd party plug ins...meaning downloaded  and installed a plug in that did not come with Elements? If so, rename them it or them with a ~ before the name.
    Check if Elements starts. If so, you can remove ~ mark from each plug in one at a time then restart until you get the hang. This will tell you which plug in causes Elements to hang.

  • How can I get Firefox to search my computer for plugins that are already there?

    How can I get Firefox to search my computer for plugins that are already there?
    Adobe's Flash player is already on my computer from IE 8. How can I get Firefox to see that it is already on my PC and use it so I don't have to download it again and possibly create other problems. Also, in my efforts to download Flash, Firefox activated IE which made me concerned that proceeding WOULD cause problems our just leave me where I am now where IE can use Flask but Firefox cannot.

    Internet Explorer uses a ActiveX version of the Flash player plugin as it does not work with other browsers.
    Download the Plugin-based browsers version from https://www.adobe.com/products/flashplayer/distribution3.html and make sure Firefox is closed when you install it.

  • While configuring omwb its asking for plugins. not able to find plugins

    Hi
    after registring it is asking for plugins. failed to search for SQL_SERVER2K.Jar file.
    Can you help me when can i find the file to down load. or otherwise.
    Thanks in advance
    Bhaskar
    [email protected]

    Hi,
    You must download the JDBC driver for SQL SERVER from this website:
    http://jtds.sourceforge.net/
    (Please download the distribution, and not the source - ex: jtds-1.2.2-dist.zip) - Unzip the file in a directory you can create independently from SQL Developer - You have to get a .jar file (ex: jtds-1.2.jar).
    Then , in SQL Developer, do the following:
    Click Tools, then Preferences, then Database, then Third Party JDBC Drivers.
    Click Add Entry.
    Select the jar file (ex: jtds-1.2.jar). for the JTDS driver you downloaded from http://jtds.sourceforge.net/
    Then Click on the Left high pane Connections.
    Click on the icon 'New Connection' .
    Give a Connection Name and a User/Password for the connection. This user must have sufficient privileges to perform the tasks that you want perform while connected to the database, such as creating, editing, and deleting tables, views, and other objects.
    Click on SQL SERVER tab.
    Specify the SQL SERVER hostname or TCP/IP address and the port.
    Click on the 'Retrieve database' button. If previous parameters and JTDS driver are correct, you will see your SQL SERVER database displayed in the list box.
    Select the database and then click on Connect.
    I hope it helps you
    Regards,
    Mireille

  • [svn:osmf:] 13167: Unit tests for Plugin refactoring work.

    Revision: 13167
    Revision: 13167
    Author:   [email protected]
    Date:     2009-12-22 14:25:34 -0800 (Tue, 22 Dec 2009)
    Log Message:
    Unit tests for Plugin refactoring work.
    Modified Paths:
        osmf/trunk/framework/MediaFrameworkFlexTest/org/osmf/plugin/TestPluginManager.as
    Added Paths:
        osmf/trunk/framework/MediaFrameworkFlexTest/org/osmf/plugin/CreateOnLoadPluginInfo.as

  • Distribution MSI for Adobe Flash Player for Plugin Browser

    The MSI File provided for distributing Adobe Flash Player for Plugin based browsers (in this case Firefox) is not working when we test in our test environment.
    It is working with the Windows XP Clients in the test group however it does not work with the Windows 7 Client Machines.  Firefox prompts for a manual download of the adobe flash software. After the manual install of the Software flash player is working but there is a new item in the program catalog. Adobe Flash Player Plugin it's size is 6.00MB. Comparatively the size that is installed by the MSI is 16.xxMB and it doesnt work.
    What I have tested
    WSUS Install of MSI - Failed, Firefox prompts to install adobe flash
    Client Install of MSI - Failed, Firefox prompts to install adobe flash
    Intercept EXE from Temp Directory and then install after uninstalling MSI - Works
    The problem appears to be in the MSI, like I said before it is working for the Windows XP Clients.  Any help would be appreciated.

    Hi Anand,
    If you have licensed Flash Player for distribution (which appears to be what you are doing), you should have received an email with the download links for the installers.  If you are distributing Flash Player without first licensing it for such, you must apply for a distribution license at Adobe Flash Player Distribution | Adobe.  Once you do this, you will receive an email with the links to download Flash Player.
    Further information on licensing, and distributing Flash Player within your organization is available in the Adobe Flash Player Administration Guide for Flash Player | Adobe Developer Connection.
    Maria

  • Photoshop CC gets stuck on scanning for plugins

    Windows 8.1    i7   256Gb SSHD 
    Photoshop Creative Cloud newly updated
    On clicking photoshop icon task manager show photoshop stuck in Background Process
    doesn't move up to Apps
    if photoshop later starts  after many minutes then
    it gets stuck for minutes on scanning for plugins
    when scanning for plugins task manager shows that it is essentially idle
    whereas LR opens immediately and shows CPU use up over 20%
    PS CC still at zero
    about 10 or 15 minutes later then PS finally wakes up
    What is the problem with photoshop getting stuck on not starting only starting as a background process and then not scaning for plug ins until 5 or 10 minutes later?

    A frequent reason for stalling Photoshop on start up, are bad font files, so I would think the same would be true with a corrupted filter or plugin. 
    CC handles third party plugins differently to older versions, and you can't point to a folder like you could with CS6 etc.  This link might help
    https://support.alienskin.com/hc/en-us/articles/200145325-Using-a-custom-plug-ins-folder-w ith-Photoshop-CC

  • Run postflight script for Plugin - step failed for mac

    So when I try and install adobe flash player on my mac OS X version 10.5, I get a message saying "The following install step failed: run postflight script for plugin. Contact the software manufacturer for assistance.

    Hello,
    Flash Player no longer supports OS X 10.5. The last version to support OS X 10.5 is 10.3.183.90.  You can download an archive.dmg file containing this version from http://helpx.adobe.com/flash-player/kb/archived-flash-player-versions.html.  After downloading and extracting the files, you'll want to install the file 'flashplayer_10_3r183_90_mac_intel.dmg'.
    Maria

  • Error Message: "Install Step Failed:run postflight script for Plugin" When Flash Player 11.7 instal

    Don't See Question/Problem w/Flash Player Installation.  Error w/11.7.700.260 Installation had errors (dialogue box)  The following install step failed: run postflight script for Plugin.Contact the Software Manufacturer for Assistance.  Please Note:  I have read all Adobe Links related to installing Flash Player and uninstalling previous version 10.3 for MAC OS 10.5.  So I have MAC OS 10.5.8 w/Firefox Browser 16.0.1 and disabled anti-viral software.  Uninstalled previous version of Flash Player 10.3.  Confirmed uninstallation.  Downloaded Flash Player 11.7.700.260  instead of 10.3.183.90 due to Adobe stated information re:replacement of 10.3 versions with 11.7 extended support.  Installation of 84% occurs then the Error Message: Installation had errors (dialogue box)  The following install step failed: run postflight script for Plugin.Contact the Software Manufacturer for Assistance.  Please help to resolve this issue as no flash player is currently on my MAC.  Thank you so much.

    Hi Mike,
    First of all, thank you so much for responding and sorry I forgot to mention my CPU; fortunately I **DO** have the 2.6 GHz Intel Core 2 Duo Processor so I could upgrade to Mac OS X Snow Leopard.  Two Questions:
    1. Do you know whether Snow Leopard sold by Apple is an upgrade or "clean install?"  If it's not a clean install, do you know (off-hand) if there are any upgrade issues?  I'm very partiall to a clean install.
    2.  Why does Adobe state (for updating Flash Player 10.3 when Adobe knows that [most likely] the 10.3 versions run on Mac OS 10.5.x?  See statement and link below...
    Kindest thoughts - Karolynn_1
    http://blogs.adobe.com/flashplayer/2013/05/extended-support-release-updated-to-flash-playe r-11-7.html
    We’re happy to announce that we are updating the version of our extended support release to Flash Player 11.7 on Mac and Windows. Flash Player 11.7 will replace version 10.3 as the extended support version beginning July 9, 2013.
    In order to continue receiving security updates, an upgrade to either Flash Player 11.7, or the standard Flash Player 11.8 release is required.
    Flash Player 11.7 provides exciting new features, including Actionscript concurrency, webcam support for StageVideo and more. It also enables Protected Mode for FireFox on Windows, a sophisticated security-in-depth feature. With Protected Mode, Flash Player runs as restricted process, making it more difficult for attackers to build working exploits. Click here to learn more.
    Flash Player 11.7 leverages hardware acceleration for audio, video and rendering to increase performance and lower CPU usage.
    To ensure the smoothest possible transition, we encourage IT organizations deploying Flash Player 11.7 in managed environments to thoroughly test audio and video playback for critical use-cases using the latest available version before deploying this release widely. When hardware-related playback and stability problems do arise, updating to the latest hardware drivers frequently resolves these issues.As a secondary workaround, the Flash Player Administrator’s Guide details mechanisms for disabling hardware and audio acceleration via mms.cfg.
    We have been hard at work to make Flash Player better than ever, and we look forward to continuing to serve you with a great web experience.

  • Crash on startup 'Scanning for Plugins'

    Help! In a moment of lax attention I've done something stupid to the Photoshop CS version (original 1) and told it to search C:/programfiles for plugins whereas I meant to tell it specifically where to look.
    So now it crashes when it gets to the 'Scanning for Plugins' part and of course I can't alter it back to what it should be.
    Now when I run Image Ready the plugins are still as normal...
    System Restore doesn't change the settings. Uninstall of the Photoshop component doesn't put it right either.
    Can someone tell me what to do (maybe uninstall/reinstall the entire CS suite - but I guess even then it will still have the bad settings)
    So is it a registry thing and if so what needs to be done to stop it searching the entire hard drive programs for plugins.
    Help would be most appreciated.
    Kind regards.
    John.

    delete "PluginCache.psp"
    it should be in something like:
    C:\Documents and Settings\YOUR_USER_NAME\Application Data\Adobe\Adobe Photoshop CS3\Adobe Photoshop CS Settings
    that folder is hidden. make sure you have the ability to see hidden files and folders turned on in explorer.
    if that doesn't clear it, delete:
    "Adobe Photoshop CS Prefs.psp" (i think that's the name, i don't currently have cs installed...

  • Photoshop fail to open - Scanning for plugins

    I have been using Photoshop CS3
    for a couple of years with no problem. Did not make any hardware/software changes.
    Now when attempting to open, it starts to open and stops at "scanning for Plugins".
    I have reset the "prefs.psp file and deleted the plugincache.psp file, rebooted and it
    continues to stop at "scanning for plugins" . Thanks for your help.

    Hi,
    Problem solved.
    I have another version of Photoshop CS3 running on another computer (#1).
    1. Copied entire plugins folder from this computer (#1) to flash drive
    2. Delete entire plugins folder from computer (#2) with scanning for plugins problem.
    3. Paste entire plugins folder from flash drive to computer (#2)
    4. Reboot computer (#2), open Photoshop, no problems.
    Thanks to all

  • Eclipse 4.5: Making it ready for plugin development

    Hi,
    I just installed Mars, Eclipse 4.5 for Java Developers.
    I started a plugin development tutorial, where the the read is told to go this path to start a new plugin project:
    File → New → Project... → Plug-in Development → Plug-in Project.
    I don't have that path.
    How can I find and install of the components I need for plugin development?
    Thanks
    Steve

    From the menu select Help > Install New Software...
    In the Available Software dialog, select the Mars update site (it's URL is http: //download.eclipse.org/releases/mars), then in the list below find "Eclipse Plug-in Development Environment" under the "General Purpose Tools" section. Select that and then you can proceed to Finish the Install dialog.

  • Can you disable shortcuts for plugins in Logic 8?

    Hi all,
    Does anybody know how I can turn off keyboard shortcuts for plugins in Logic 8?
    Specifically, I've been using FAW's Circle a lot lately, and when I'm in one of the windows there is a button that defaults to "randomize". Sadly that button is Enter, which I use to Play.
    So, often I will be tweaking a patch and hit Enter to hear it in context and it will mess up all my settings! Of course, there's no way to undo that either. Drrrrr.
    I could have sworn I saw something about that in the manual the other day but I've just been through it and I can't seem to find it anywhere. It's probably right in front of me.
    thanks!
    Matthew

    Does anybody know how I can turn off keyboard shortcuts for plugins in Logic 8?
    Specifically, I've been using FAW's Circle a lot lately, and when I'm in one of the windows there is a button that defaults to "randomize". Sadly that button is Enter, which I use to Play.
    So, often I will be tweaking a patch and hit Enter to hear it in context and it will mess up all my settings! Of course, there's no way to undo that either. Drrrrr.
    I could have sworn I saw something about that in the manual the other day but I've just been through it and I can't seem to find it anywhere. It's probably right in front of me.
    It's very annoying isn't it. I am constantly irritated by my usual Logic keycommands being overridden just because I happen to have a plug in editor window selected. Same thing happens to me often with Reaktor, enter seems to just load up the next ensemble in the list, so hey presto I lose all my settings.
    I know in Pro Tools there is (or at least used to be) a setting to allow keyboard input to pass through to plug ins, or to disable it. Logic should absolutely have this function as well, and it should have a simple toggle switch to turn it on or off. I've already written to Logic feedback about this, but you should do the same, the more complaints they get about it the better.
    http://www.apple.com/feedback/logicpro.html

Maybe you are looking for

  • Unable to change font color for Plain Text Emails

    I have a Win7 Enterprise x86 machine running Outlook 2010.  I am unable to read plain text emails.  When I go into Options->Mail->Stationary and Fonts, the preview box under "Composing and reading plain text messages" is all white.  I've tried changi

  • Trouble Converting to Date..Pls Help....!

    Good day gurus! Can anyone help me figure out how to make an appropriate sql statement in converting a "char" datatype into a "date" datatype? To be more exact this database is actually a foxpro database (.dbf). I am migrating this one to oracle. My

  • HTTP request was forbidden with client authentication scheme 'anonymous'

    Hi, We have updated our support Package for version BPC NW 10.0 release 801 from 0002 to 0005. After the update we are not being to access the server folders in EPM Add-in. We have the following error "HTTP request was forbidden with client authentic

  • Temp Tables Space error

    Hi Friends, We are using two fact tables in a query along with three master tables. We have tried to increase the table space for temp several times. But due to loads of data increasing in the facts We are struck back by the error could not increase

  • EBS Interpretation Algorithm 015 - FEBEP-CHECT has only 13 characters

    We have customized SAP for uploading a MT940 and to automatically clear the customer with the ZUONR. We have - assigned the external transaction to a posting rule with interpretation algorithm 015 - defined the search string and the search string use