Examples of addToEnvironment()


Examples of javax.naming.Context.addToEnvironment()

    public void modifyEnvironment(){
        try {
            Context initCtx = new InitialContext();
            Context myEnv = (Context) initCtx.lookup("java:comp/env");

            myEnv.addToEnvironment("flt00", new Float(INJECTED_FLOAT));
            myEnv.removeFromEnvironment("flt00");

        } catch (NamingException e) {
            throw new IllegalStateException("The context could not be obtained.");
        }
View Full Code Here

Examples of javax.naming.Context.addToEnvironment()

    public Object addToEnvironment(String propName, Object propVal) throws NamingException {
        Context ctx = getDefaultContext();

        if (ctx != null) {
            ctx.addToEnvironment(propName, propVal);
        }
       
        return env.put(propName, propVal);
    }
View Full Code Here

Examples of javax.naming.Context.addToEnvironment()

        if (toReturn != null) {
            String packages = Utils.getSystemProperty(Context.URL_PKG_PREFIXES, null);

            if (packages != null) {
                toReturn.addToEnvironment(Context.URL_PKG_PREFIXES, packages);
            }
        }

        return toReturn;
    }
View Full Code Here

Examples of javax.naming.InitialContext.addToEnvironment()

{

    public Object create() throws Exception
    {
        InitialContext ic = new InitialContext();
        ic.addToEnvironment(InitialContext.INITIAL_CONTEXT_FACTORY, MuleInitialContextFactory.class.getName());

        // Bind our service object
        ic.bind("SimpleMathsUMO", new SimpleMathsComponent());
        ic.bind("MatchingUMO", new MatchingMethodsComponent());
        ic.bind("TestService", new MatchingMethodsComponent());
View Full Code Here

Examples of javax.naming.directory.DirContext.addToEnvironment()

    public void testRequestWithoutManageDsaITControl() throws Exception
    {
        DirContext ctx = getWiredContext( getLdapServer() );

        // this removes the ManageDsaIT decorator from the search request
        ctx.addToEnvironment( DirContext.REFERRAL, "throw" );

        SearchControls ctls = new SearchControls();
        String[] attrNames =
            {
                "objectClasses",
View Full Code Here

Examples of javax.naming.directory.DirContext.addToEnvironment()

        ctx.createSubcontext( oldRdn, attributes );

        // modify Rdn
        String newCn = "Tori Amos";
        String newRdn = "cn=" + newCn;
        ctx.addToEnvironment( "java.naming.ldap.deleteRDN", "False" );
        ctx.rename( oldRdn, newRdn );

        // Check, whether old Entry does not exists
        try
        {
View Full Code Here

Examples of javax.naming.directory.DirContext.addToEnvironment()

        ctx.createSubcontext( oldRdn, attributes );

        // modify Rdn
        String newCn = "Tori Amos";
        String newRdn = "cn=" + newCn;
        ctx.addToEnvironment( "java.naming.ldap.deleteRDN", "false" );
        ctx.rename( oldRdn, newRdn );

        // Check, whether old entry does not exist
        try
        {
View Full Code Here

Examples of javax.naming.directory.DirContext.addToEnvironment()

        ctx.createSubcontext( oldRdn, attributes );

        // modify Rdn
        String newCn = "Tori Amos";
        String newRdn = "cn=" + newCn;
        ctx.addToEnvironment( "java.naming.ldap.deleteRDN", "true" );
        ctx.rename( oldRdn, newRdn );

        // Check, whether old Entry does not exist anymore
        try
        {
View Full Code Here

Examples of javax.naming.directory.DirContext.addToEnvironment()

        Attributes attributes = this.getPersonAttributes( snVal, cnVal );
        ctx.createSubcontext( oldRdn, attributes );

        // modify Rdn from cn=... to sn=...
        String newRdn = "sn=" + snVal;
        ctx.addToEnvironment( "java.naming.ldap.deleteRDN", "false" );
        ctx.rename( oldRdn, newRdn );

        // Check, whether old Entry does not exists
        try
        {
View Full Code Here

Examples of javax.naming.directory.DirContext.addToEnvironment()

        Attributes attributes = this.getPersonAttributes( snVal, cnVal );
        ctx.createSubcontext( oldRdn, attributes );

        // modify Rdn from cn=... to sn=...
        String newRdn = "sn=" + snVal;
        ctx.addToEnvironment( "java.naming.ldap.deleteRDN", "true" );
        try
        {
            ctx.rename( oldRdn, newRdn );
            fail( "Rename must fail, mandatory attirbute cn can not be deleted." );
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.