Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2005-2015 Red Hat, Inc. Red Hat 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 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 io.fabric8.cdi.bean;
public class ProducerBean<X> extends BaseBean<X> {
    private final Producer<X> producer;
    public ProducerBean(String nameType typeProducer<X> producerAnnotation... annotations) {
        this. = producer;
    public Producer<X> getProducer() {
        return ;
    public X create(CreationalContext<X> creationalContext) {
        if ( == null) {
            throw new IllegalStateException("No producer has been specified");
        return .produce(creationalContext);
    public void destroy(X instanceCreationalContext<X> creationalContext) {
    public Class<? extends AnnotationgetScope() {
        return Singleton.class;
    public boolean equals(Object o) {
        if (this == oreturn true;
        if (o == null || getClass() != o.getClass()) return false;
        ProducerBean that = (ProducerBeano;
        if (getId() != null ? !getId().equals(that.getId()) : that.getId() != nullreturn false;
        if (getBeanClass() != null ? !getBeanClass().equals(that.getBeanClass()) : that.getBeanClass() != null)
            return false;
        return true;
    public int hashCode() {
        int result = getId() != null ? getId().hashCode() : 0;
        result = 31 * result + (getBeanClass() != null ? getBeanClass().hashCode() : 0);
        return result;
New to GrepCode? Check out our FAQ X