org.apache.geronimo.yoko.ORBInitializer Maven / Gradle / Ivy
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.geronimo.yoko;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.omg.CORBA.LocalObject;
import org.omg.PortableInterceptor.ORBInitInfo;
import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName;
/**
* @version $Revision: 452600 $ $Date: 2006-10-03 12:29:42 -0700 (Tue, 03 Oct 2006) $
*/
public class ORBInitializer extends LocalObject implements org.omg.PortableInterceptor.ORBInitializer {
private final Logger log = LoggerFactory.getLogger(ORBInitializer.class);
public ORBInitializer() {
if (log.isDebugEnabled()) log.debug("ORBInitializer.");
}
/**
* Called during ORB initialization. If it is expected that initial
* services registered by an interceptor will be used by other
* interceptors, then those initial services shall be registered at
* this point via calls to
* ORBInitInfo.register_initial_reference
.
*
* @param info provides initialization attributes and operations by
* which Interceptors can be registered.
*/
public void pre_init(ORBInitInfo info) {
}
/**
* Called during ORB initialization. If a service must resolve initial
* references as part of its initialization, it can assume that all
* initial references will be available at this point.
*
* Calling the post_init
operations is not the final
* task of ORB initialization. The final task, following the
* post_init
calls, is attaching the lists of registered
* interceptors to the ORB. Therefore, the ORB does not contain the
* interceptors during calls to post_init
. If an
* ORB-mediated call is made from within post_init
, no
* request interceptors will be invoked on that call.
* Likewise, if an operation is performed which causes an IOR to be
* created, no IOR interceptors will be invoked.
*
* @param info provides initialization attributes and
* operations by which Interceptors can be registered.
*/
public void post_init(ORBInitInfo info) {
try {
if (log.isDebugEnabled()) log.debug("Registering IOR interceptor");
try {
info.add_server_request_interceptor(new ServiceContextInterceptor());
} catch (DuplicateName dn) {
log.error("Error registering interceptor", dn);
}
} catch (RuntimeException re) {
log.error("Error registering interceptor", re);
throw re;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy