Wednesday, February 11, 2009

Going back to dark ages

After coding in Java for over a decade, half of that with IntelliJ I am now trying to code Objective-C in Xcode. As with learning to use any new IDE this is not a fun exercise and I am constantly comparing Xcode to IntelliJ & so far there is only one winner. I can only find only a few built-in refactorings in Xcode. Does Xcode has anything like plugins? Is there a better tool for refactoring Objective-C?

Wednesday, February 4, 2009

getting the current Subject in oc4j

This is a copy of an email I sent.

The problem: How do you get the subject associated with the currently authenticated user.

Solution: There are two ways in oc4j.

* The standard way

http://download.oracle.com/docs/cd/E12524_01/web.1013/e12514/authoriz.htm#CHDDAFBF

1. Configure JAAS mode and
2. invoke Subject.getSubject(AccessController.getContext());

* OC4J proprietary way

Invoke oracle.oc4j.security.Security.getSubject()

This requires an oc4j patchset in 10.1.3.3 and is automatically available in 10.1.3.4