CookieManager and application specific context.

Hello

I'm trying to understand how the CookieManager are managed by HttpURLConnection.

Reading the javadoc:
public static void CookieManager.setDefault (CookieManager myManager);
Sets (or destroys) the system-wide cookie Manager. Note: non-standard http protocol managers can ignore this parameter.
I understand that there is a way to control the CookieManager used by java.net.

I don't want to use only a single CookieManager for the JVM, I want to move from a CookieManager according to a specific application context.
Back to the javadoc: Note: non-standard http protocol managers may ignore this parameter.
The right way to JavaSE API to control the CookieManager is to write my own HttpURLConnection and use java.net.URL #setURLStreamHandlerFactory (URLStreamHandlerFactory) as a bootstrap.

So what are the solutions to implement this functionality:
* Rewrite the entire mechanism HttpURLConnection: too complicated/code rewrite.
* Set the default CookieManager with a ThreadLocal CookieHandler wrapper: some hackers.

Am I missing something?

Thanks a lot for your suggestions.

user13683384 wrote:
So what are the solutions to implement this functionality:
* Rewrite the entire mechanism HttpURLConnection: too complicated/code rewrite.
* Set the default CookieManager with a ThreadLocal CookieHandler wrapper: some hackers.

Yes, those who are pretty much your options. Unfortunately, there are still a few corners of the jdk that have not truly designed for "shared" Java virtual machines There are a few net API with jvm settings (authenticator is another problem).

I can't imagine that re-write HttpURLConnection would never a good idea, except in extreme scenarios. at the very least, I would first check other third-party http, such as apache commons http client clients.

personally, I would try the ThreadLocal approach (I have it considered other APIs that need similar, but never finished). However, the one caveat is that you must be careful that the other threads do not have under the hood. If the used HttpURLConnection another thread internally, your solution may not work.

Tags: Java

Similar Questions

  • What I have to do, I can send and save my pictures?  Do I need an application specific jpeg?

    What do I need send and save my photos in contact photo adobe?  Do I need an application specific jpeg?

    You need a specific application. As soon you have saved your document (-up arrow to the left) you can find the share options - see my attached screenshot

  • Error: The application-specific permission settings grant Local Activation permission for the COM server application in the Windows XP computer.

    Original title: DCOM {E9F9ED00-7705-101B-9802-0000C07B665C}.

    I have this message DCOM in the registry: "the application-specific permission settings do not grant Local Activation permission for the COM with CLSID {E9F9ED00-7705-101B-9802-0000C07B665C} server application the user... xxxx...". (I deliberately placed the "xxxx" instead of my current PC for security reasons). This security permission can be modified using the Component Services administrative tool." I tried to look through the forum here, and I found elements that were close and others are not. so if anyone knows where I can go make the adjustments, it could save our society approximately $10K, because my new bosses are ready to install all new hardware and software, but if we could find a much simpler approach to this problem, this would make the new kid on the block like a champ look.
    We have a Window XP, the flat touch screen PC, running a few packages of software reviews that keep a record of our SCADA system trend.

    At random times around the clock, the PC will just restart and return to the logon screen. There is no other necessary users, so we have only the journal administrator form. As soon as we open the administrator it is specially configured to run a specific program of our choice, but if the PC keeps restarting whenever it feels like it, there is no history chart tend to save. It is essential, that we need.

    Hello

    Your Windows XP question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the forum TechNet for assistance:

    http://social.technet.Microsoft.com/forums/en/itproxpsp/threads

    Hope the helps of information.

  • Event ID 10016 - the application-specific permission settings do not local Activation permission for the COM with the CLSID server application

    Lately, I'm getting this system error a lot now that I've upgraded to Windows 8 Pro is an event DistributedCom 10016 ID. Here is the text of the error:

    The application-specific permission settings do not local Activation permission for the COM with the CLSID server application

    {D63B10C5-BB46-4990-A94F-E40B9D520160}

    and APPID

    {9CA88EE3-ACB7-47C8-AFC4-AB702511C276}

    the user NT AUTHORITY\SYSTEM SID (S-1-5-18) from the address LocalHost (using LRPC) running in the container of the application unavailable SID (not available). This security permission can be modified using the Component Services administrative tool.

    Anyone has an idea why I get this error?
    Walt

    Same thing here. Grayed. Windows 8.1 seems to fill the observer of events with many more errors than previous versions.

    Edit: OK, discovered why it is grayed out. There are 2 reg key, you must set permissions before going to the Configuration of DCOM in component services. The CLSID key and the APPID key.

    From another forum, although it applies to a different application, same principle:

    1. open Regedit.
    2. go in HKEY_Classes_Root\CLSID\ * CLSID *.
    Note: * CLSID * stand for the ID that appears in your event viewer error. In your case, it is {C2F03A33-21F5-47FA-B4BB-156362A2F239}.
    3. right-click on it and select authorization.
    4. click on Advance and change owner to administrator. Also click on the box that will appear below the threshold of owner.
    5. apply a full control.
    6. close the tab, then go to HKEY_LocalMachine\Software\Classes\AppID\ * APPID *.
    Note: * AppID * is the ID that appears in your event viewer. In your case, it is {316CDED5-E4AE-4B15-9113-7055D84DCC97}.
    7 right-click on it and select authorization.
    8. click on Advance and change the owner to administrators.
    9. click on the box that will appear below the line owner.
    10. click on apply and grant full control to the administrators.
    11. close all tabs and navigate to the administration tool.
    12. open component services.
    13. click on the computer, click my computer, and then click DCOM.
    14 find the corresponding service that appears on the display of the error.
    15. right-click on it, and then click Properties.
    16. click the Security tab, and then click Add a user. Add the SYSTEM and then apply.
    17. check enable local.

    Then use the relevant keys here and the DCOM Config utility should give you access greyed onareas:

    CLSID:

    {D63B10C5-BB46-4990-A94F-E40B9D520160}

    and APPID

    {9CA88EE3-ACB7-47C8-AFC4-AB702511C276}

  • Definition of user access to the specific context.

    Hi experts,

    I have a requitement

    We have some limitations for the user to access specific scenarios. But what is happening is that these users can able to run scenarios in any CONTEXT.

    If we want to restirict the user to access a specific context, how can we do?

    Please advice...

    concerned,
    K

    Hi K,

    Adding a few more points to the previous answer,

    user10439173 correct me if I'm wrong... :)

    1 duplicate the CONNECTION profile provided with ODI (Sunopsis) and rename the copy as MY NG CONNECT.
    2. in the new MY NG CONNECT profile, for the purpose of 'Context', on the ' * view * ""Definition"of the method tab, uncheck"class Privilege ".
    3. assign the new profile MY NG CONNECT to targeted users ODI (Sunopsis).
    4 create/update the user with this profile. Finally, drag & drop on each user name, the contexts to which access must be allowed (since the topology Manager).

    Thank you
    G

  • Apple music and applications when you change the country

    Hello guys! I'm of the Russia. Moved to Canada some time ago. I obviously Russian Russian and Russian credit card App Store account. What happens to my Apple music and applications when I change the country for the Canada and change the method of payment of Canadian credit card? I hope that I will not need to redownload music...

    You shouldn't have to re-download the music already on your computer, but everything you need to redownload will have to be in the Canadian store, everything is not in all stores

  • I can not print from Firefox, but can all the other browsers and applications (such as MS Word, notepad, etc.). I get a misprint on the print monitor as if it was a problem of queue.

    This is a recent development, but I can not print anything in Firefox. Printing open normally, it's going to the right printer that works... I can print other browsers and applications. It acts like it is in queue and then a printing error occurs and it will not be printed. I closed and reopened Firefox, open in safe mode, cleaned cache/history/cookies and restarted twice. Nothing makes no difference. Also tried printing from the preview before print that had the same result. I can print all other browsers and applications without problem, so it must be within Firefox.

    See this:

    http://KB.mozillazine.org/Problems_printing_web_pages

  • My phone 16 gig is constantly low on storage, well all I can see to manage storage is < 2 GB of music, mail, photos and applications.

    My phone 16 gig is constantly low on storage, well all I can see to manage storage is < 2 GB of music, mail, photos and applications.

    Open iTunes on your computer, and then connect your device to your computer. In iTunes, select your device. You will see a bar that shows how much storage your iOS content uses, divided by type of content. Roll your mouse over a type of content, as well as other applications, to find more information. If storage is not yet put in correspondence to the top, then back up the phone via iTunes or iCloud, wipe the phone to the factory settings and restore your information. That should erase all ghosts who gets up on the device.

    Check your storage space on your iPhone, iPad and iPod touch - Apple Support

  • Deleted many pictures and applications; photos - 0-available.  Impossible to read or send emails.

    Deleted many pictures and applications; bought 50 GB iCloud storage; Still - 0 - storage on the iPad.  Impossible to read or send emails.  Help!

    Additional storage iCloud purchase will give you more space for your backups, he won't give you more space on your iPad.

    Since the removal of the pictures (you have also emptied the recently deleted album?) have you tried a soft-reset/reboot to see if that frees up space? Press and hold buttons sleep and home for 10-15 seconds (ignore the "slide to turn off"), then the Apple logo should appear and the iPad should restart

  • I lost my recovery CD and application

    How can I download the recovery CD and application for satellite pro model: 4600

    Hello Fernando

    CD recovery or Tools & Utilities CD just not downloadable reorganize by partner service authorized in your country. Alternatively, you can install the operating system using the CD of the full version of Microsoft. All the necessary drivers and tools that you can find on Toshiba download site under http://eu.computers.toshiba-europe.com > support & downloads.

    Good bye

  • Satellite A100 PSAA9A - drivers and applications from the recovery disk

    This laptop was reformated HARD drive and I decided to try Windows 7 (beta), which is currently installed and working well. I would like to install the original drivers and applications from the Toshiba recovery disc but I don't want to reinstal the operating system (XP). Is this possible?

    As far as I know that is not possible because applications from the recovery disk and drivers are for Windows XP and they are not compatible with Windows 7.
    In addition it of not possible to install the only special drivers or applications from the recovery disc.

    You can download all the drivers and tools on the site of Toshiba, but I doubt that it of compatible with Windows 7, but you can try it out and post your result here.
    http://EU.computers.Toshiba-Europe.com

  • Windows XP SP3: Unable to start, System Restore cannot drag and drop ALL the files/folders on the desktop and applications, many unable to start, services cannot search, cannot copy or transfer the any files folders...

    After a recent power outage, my system has restarted with a weird and very common Windows problems range. The system boots fine, all my personal files/folders/apps are intact, have suddenly stopped almost all functions of applications, but many crucial functions of the Windows kernel. Everything seems to point to several Windows Services are unable to start (administrative tools on the start menu). I am running Win XP SP3 and that he was going to upgrade to Windows 7, but I wanted to backup everything in advance. As I have 29 000 hours on my C: drive and a lot of time invested in my system, files, and applications, I am extremely reluctant to risk losing my files and applications by performing any type of reinstalling Windows. Strangely, begin to almost all my apps and all my files are accessible for the most part, but I've lost the ability to drag and drop files, folders or items in a list within the applications COMPLETELY. I can't copy or paste anything, can't move the desktop icons (although I can create new files and folders). So at the moment I can't save anything or even a single file transfer to a hard drive on another storage medium. Immediate reaction: try safe mode and try the system restore safe mode has the same problems (likely due to the large number of system services that inexplicably refuses to start) and the system restore says an error window saying "system restore is not able to protect your computer at this time. try restoring the system running and restart again", which of course NEVER changes. It's the equivalent of getting a tire on your car in the middle of nowhere to find the spare tire flat and the missing Jack. I have used to be fanatical about the definition of the regular restore points, but now can not access them. I have backups of most of my personal files, but over years have lost most of the original installation CD for many of my applications (there are over 100 applications on my system) and I don't want to lose the file associations and architecture of directory tree that it took my so long to implement. I started with Win XP media center edition of first (circa 2004 or almost) and have migrated twice more of 3 hard disks and 2 computers. All this time (5 years of daily use), I have NEVER known so many malfunctions for as many Windows basic and vital functions at the same time. I tried a lot of 3rd party "windows fix - it / registry repair" apps, all have no effect. Everything I can speculate is there was some serious damage to the registry and have no idea how/why so many Services refuse to start. In MMC, more than half of the services actually start and run, the rest all give the error message "the service or dependencies is not start (error 1068).» In addition, very oddly, no. APPS or windows appear in the toolbar AT ALL, but the Quick Launch toolbar works very well, just like the tray button and start tasks (?! )!). If I reduce a window, it "disappears" (Nothing on the task bar), but I can restore it using the alt - tab keyboard shortcut to switch apps, so all applications/windows appear on the list of the Task Manager. A few apps is paralyzed bad, as the player windows media, itunes, etc. (I guess because the service windows audio can not not start), some won't start at all, but 90% of them work fine, except to try to copy or back up all files. I can create new files, however. I'm desperate to find a solution to repair XP3 Win WITHOUT losing my installed applications and files, before I try and switch to WIndows 7. Any help/suggestions/links/advice would be much appreciated. I'm an experienced user, but I've never met so many malfunctions based on the OS at a time. I, however, very painfully learned (years before that my system so complex) it's been almost a re-installation of Windows guarantees to lose my installed apps and files, the directory tree architecture associations.

    Help, please!

    I'll be honest with you - your message is so difficult to read that I don't bother to go through all that. Next time consider using white space, ball or points numbered, etc. to make your message more readable. I stopped reading after your first sentence and only scanned the rest quickly. I do not mean to hurt your feelings; just trying to help you get targeted answers you need for the future.

    The blackout has corrupted your Windows installation. Back up your data now. Since you have problems so much, it would be probably best is to remove the hard drive, put it in a USB drive enclosure and attach it to another computer to copy the data OR start the target with Linux Livecd such as Knoppix system and copy the data to an external hard drive. IOW, do not use the damaged windows to try to get your data.

    You can try a repair that will leave your programs and facility data intact, but with this widespread bribery, it is unlikely to work. However, it takes only a few minutes and is so worth a try. If the repair facility does not work there is nothing to do, but a clean install. And Yes, it will mean that over again.

    Consider buying a UPS to help prevent future damage by power outages. For a single computer, you should look for one in the area of $60 to 80. A more expensive UPS is not necessary. Another good disaster recovery strategy is to buy an external hard drive and Acronis True Image. You can image your system (and can make an incremental backup image so that your image is still current). You can apply your image and be back running that you were in relatively few minutes after a hard drive or Windows to fail.

    http://www.michaelstevenstech.com/XPrepairinstall.htm - repair install how-to
    http://michaelstevenstech.com/cleanxpinstall.html - Clean install - how-to
    http://www.elephantboycomputers.com/page2.html#Reinstalling_Windows - you will need at hand MS - MVP - Elephant Boy computers - Don ' t Panic!

  • I have an error that says"the application-specific permission settings do not permit grant local activation for the application of the COM CLSID/w Server (BA 126ADI-2166-11 D 1-B1D0-0008 (OSFC1270))

    The error indicates that the application-specific permission settings do not grant approval to local activation for the application server COM with the CLSID (BA 126ADI-2166-11 D 1 - BLM - OO8 OSFC127OE) to the user NT Autoritative / network service SID (S-1-5-20).  The error message says it can be changed by using the component services administration tool.  I can't say what to do when I get to the admin tools.  Can you help me..

    Hi mildrednorcross,

    1. when exactly you receive this error message?

    2. is your computer connected to the server or the domain?

    If your computer is on a domain network, your question will be better suited for the IT Pro TechNet public. Please post your question in the forum TechNet for assistance:

    http://social.technet.Microsoft.com/forums/en/itproxpsp/threads

    Hope the helps of information.

  • Clean boot let B1-710 acer operating system and applications pre-loaded on Tablet?

    Tablet Acer leave B1-710 boot operating system and applications pre-loaded on tablet. It erases only my information and apps that I put on the tablet.

    http://Acer--UK.custhelp.com/app/answers/detail/A_ID/29892/~/Acer-Iconia-B1-A71-and-B1-710-factory-d...

    a factory data reset will return the tablet to factory default with the last OS update; so plant apps only, all your data and applications will be deleted.

  • Security event log getting the message "local computer maybe not the files of the necessary registry information or message DLL to display messages from a remote computer" for all entries. System and application logs do not receive messages

    PC is Windows XP.  The server is Windows 2000.  I have administrative rights on both machines.

    On getting PC security event log do message "local computer, maybe not the files of the necessary registry information or message DLL to display messages from a remote computer" for all entries.  System and application logs do not receive messages

    Hi carmol,.

    Your question of Windows is more complex than what is generally answered in the Microsoft Answers forums. It is better suited to the audience on TechNet forum.

    Please post your question in the Sub forum. Link: http://social.technet.microsoft.com/Forums/en-us/winserverManagement/threads

    With regard to:

    Samhrutha G S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

Maybe you are looking for